/* ===================================
   Base Styles - Shared across all areas
   =================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: ProximaNova;
    background-color: #FBF8EF;
    overflow-x: hidden;
    margin-bottom: 0;
}

/* ===================================
   Custom Navigation
   =================================== */
.custom-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .nav-btn:hover {
        background: rgba(255,255,255,0.3);
        transform: scale(1.05);
    }

.nav-btn-icon {
    font-size: 16pt;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-actions {
    display: flex;
    gap: 10px;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: white;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #667eea;
}

/* ===================================
   Main Content
   =================================== */
.main-content {
    margin-top: 60px;
    padding: 20px 15px;
    min-height: calc(100vh - 60px);
    overflow-x: hidden;
}

/* ===================================
   Page Header with Back Navigation
   =================================== */
.page-header {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    column-gap: 12px;
    min-height: 40px;
    margin-bottom: 20px;
}

.back-btn {
    background: white;
    border: none;
    color: #667eea;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    aspect-ratio: 1 / 1;
    flex: 0 0 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
}

    .back-btn:hover {
        background: #667eea;
        color: white;
        transform: scale(1.05);
    }

    .back-btn i {
        font-size: 1.25rem;
    }

.page-title {
    grid-column: 2;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-header > .back-btn {
    grid-column: 1;
}

.page-header > .share-btn {
    grid-column: 3;
}

/* ===================================
   List Page Header (Bestenliste, ChallengeList)
   =================================== */
.list-page-header {
    text-align: center;
    padding: 16px 16px 20px;
    margin: -20px -15px 12px -15px;
    position: relative;
    background: white;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-top: none;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.list-page-header .back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
}

.list-page-icon {
    width: 80px;
    height: 80px;
    border: 2px solid rgba(102, 126, 234, 0.25);
    border-radius: 20px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 36px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.list-page-icon i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.list-page-title {
    font-size: 24pt;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.list-page-subtitle {
    margin: 8px auto 0;
    max-width: 680px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4B5563;
    line-height: 1.45;
}

/* ===================================
   Section Styles
   =================================== */
.section {
    margin-bottom: 30px;
}

.section-header {
    color: #444544;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 16pt;
    font-weight: 900;
    color: #333;
    margin: 0;
}

.view-all-btn {
    color: #667EEA;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .view-all-btn:hover {
        color: #764ba2;
        gap: 8px;
    }

/* ===================================
   Empty States
   =================================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 0.95rem;
}

/* ===================================
   Account Page Styles
   =================================== */
.account-page {
}

.account-header {
    position: relative;
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 0 24px 24px;
    margin: -20px -15px 24px -15px;
    color: white;
}

.profile-back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    color: white;
    font-size: 1.2rem;
    opacity: 0.85;
    text-decoration: none;
}

.profile-back-btn:hover {
    opacity: 1;
}

.account-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 40px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.account-avatar-rounded {
    border-radius: 20px;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-username {
    font-size: 24pt;
    font-weight: 900;
    margin: 0 0 4px 0;
}

.account-email {
    font-size: 12pt;
    font-weight: 600;
    opacity: 0.9;
    margin: 0;
    word-break: break-all;
}

.account-details {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 12pt;
    font-weight: 400;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 140px;
}

.detail-value {
    font-size: 12pt;
    font-weight: 700;
    color: #333;
    min-width: 0;
    word-break: break-all;
    text-align: right;
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #333;
}

.action-btn i:first-child {
    font-size: 1.2rem;
    color: #667eea;
    width: 24px;
    text-align: center;
}

.action-btn span {
    flex: 1;
    font-size: 12pt;
    font-weight: 400;
}

.action-btn-danger {
    color: #B40000;
}

.action-btn-danger i:first-child {
    color: #B40000;
}

.action-btn-danger:hover {
    color: #B40000;
}

/* ===================================
   Alert Cards
   =================================== */
.alert-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.alert-card i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.alert-card div {
    flex: 1;
}

.alert-card strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.alert-card p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.9;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-warning i {
    color: #856404;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-success i {
    color: #155724;
}

/* ===================================
   Form Styles
   =================================== */
.form-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12pt;
    font-weight: 400;
    color: #333;
    margin-bottom: 8px;
}

.form-label i {
    color: #667eea;
}

.form-label .form-check-input {
    margin-top: 0;
    vertical-align: middle;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 12pt;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    transition: border-color 0.2s, background-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-input::placeholder {
    color: #aaa;
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23666' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
}

.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #e9ecef;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* Profile Picture Upload */
.profile-picture-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.profile-picture-preview {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #e0e0e0;
}

.profile-picture-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture-preview i {
    font-size: 60px;
    color: #ccc;
}

.profile-picture-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.file-input-hidden {
    display: none;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #667eea;
    background: white;
    border: 1px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: #667eea;
    color: white;
}

.btn-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #dc3545;
    background: white;
    border: 1px solid #dc3545;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #dc3545;
    color: white;
}

.btn-remove input[type="checkbox"] {
    display: none;
}

.btn-remove:has(input:checked) {
    background: #dc3545;
    color: white;
}

.validation-summary {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.validation-summary:empty {
    display: none;
}

.field-validation {
    display: block;
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 16pt;
    font-weight: 400;
    color: white;
    background: #667eea;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #764ba2;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-secondary:hover {
    background: #f8f9fa;
    color: #333;
}

/* ===================================
   Responsive - Mobile (max-width: 576px)
   =================================== */
@media (max-width: 576px) {
    .custom-nav {
        padding: 0 10px;
    }

    .nav-logo {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 14pt;
    }

    .main-content {
        padding: 15px 10px;
    }

    .account-header {
        margin: -15px -10px 24px -10px;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .back-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        flex-basis: 36px;
    }

        .back-btn i {
            font-size: 1.1rem;
        }

    .share-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        flex-basis: 36px;
    }

    .share-btn i {
        font-size: 1.1rem;
    }

    .page-header {
        grid-template-columns: 36px 1fr 36px;
    }
}

/* ===================================
   Responsive - Tablet+ (min-width: 768px)
   =================================== */
@media (min-width: 768px) {
    .main-content {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===================================
   Share Button
   =================================== */
.share-btn {
    background: white;
    border: none;
    color: #667eea;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    aspect-ratio: 1 / 1;
    flex: 0 0 40px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-left: auto;
}

.share-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.share-btn i {
    font-size: 1.25rem;
}

.share-btn:active {
    transform: scale(0.95);
}

/* ===================================
   Toast Notification
   =================================== */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    animation: toastFadeInOut 3s ease forwards;
}

@keyframes toastFadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* ===================================
   Page Footer
   =================================== */
.page-footer {
    text-align: center;
    padding: 20px 16px 24px;
    max-width: 480px;
    margin: 0 auto;
}

.page-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.page-footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.page-footer-links a:hover {
    color: #667eea;
}

.page-footer-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ccc;
}

.page-footer-copy {
    font-size: 0.8rem;
    color: #aaa;
    margin: 0;
}

/* ===================================
   Public Body Overrides
   (for non-app pages: public, identity)
   =================================== */
.public-body .main-content {
    min-height: auto;
}
