/* === PROFILE.CSS ===
 * /assets/css/profile.css
 * НАЗНАЧЕНИЕ: Стили страницы профиля (СВЕТЛАЯ тема платформы)
 * СВЯЗИ: index.php, assets/js/profile.js
 * РАЗМЕР: ~550 строк
 */

/* ============================================
   PROFILE LAYOUT
   ============================================ */

.profile-sections {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============================================
   PROFILE HEADER
   ============================================ */

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 10px;
    background: var(--bg-card, #FFFFFF);
    border-radius: var(--radius-xl, 16px);
    border: 1px solid #E5E7EB;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    margin-bottom: 10px;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-gold, #FFD700);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary, #1A1A1A) !important;
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.profile-email {
    font-size: 0.85rem;
    color: var(--text-muted, #999999);
    margin: 0 0 0.5rem 0;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-badge.free {
    background: rgba(156, 163, 175, 0.12);
    color: #6B7280;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.profile-badge.premium {
    background: rgba(255, 215, 0, 0.12);
    color: var(--color-gold-dark, #B8860B);
    border: 1px solid rgba(255, 215, 0, 0.35);
}

.profile-badge i,
.profile-badge svg {
    width: 12px;
    height: 12px;
}

/* ============================================
   PROFILE SECTIONS
   ============================================ */

.profile-section {
    background: var(--bg-card, #FFFFFF);
    border-radius: var(--radius-xl, 16px);
    border: 1px solid #E5E7EB;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    padding: 10px;
}

.profile-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #1A1A1A) !important;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-gold, #FFD700);
}

.profile-section-title i,
.profile-section-title svg {
    color: var(--color-gold, #FFD700);
    width: 18px;
    height: 18px;
}

/* ============================================
   FORM STYLES
   ============================================ */

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.profile-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-form-group.full-width {
    grid-column: 1 / -1;
}

.profile-form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary, #666666);
}

.profile-form-input,
.profile-form-select {
    padding: 8px 10px;
    background: var(--bg-secondary, #F5F5F5);
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-md, 8px);
    color: var(--text-primary, #1A1A1A);
    font-size: 0.9rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-form-input:focus,
.profile-form-select:focus {
    outline: none;
    border-color: var(--color-gold, #FFD700);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.15);
    background: var(--bg-card, #FFFFFF);
}

.profile-form-input:disabled,
.profile-form-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-form-input::placeholder {
    color: var(--text-muted, #999999);
}

.profile-form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 2rem;
}

.profile-form-select option {
    background: var(--bg-card, #FFFFFF);
    color: var(--text-primary, #1A1A1A);
}

.profile-age-display {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 2px 8px;
    background: rgba(255, 215, 0, 0.12);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--color-gold-dark, #B8860B);
}

/* ============================================
   TELEGRAM BLOCK
   ============================================ */

.telegram-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 136, 204, 0.06);
    border: 1px solid rgba(0, 136, 204, 0.15);
    border-radius: var(--radius-lg, 12px);
}

.telegram-block.connected {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
}

.telegram-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 136, 204, 0.1);
    border-radius: var(--radius-md, 8px);
    flex-shrink: 0;
}

.telegram-block.connected .telegram-icon {
    background: rgba(16, 185, 129, 0.1);
}

.telegram-icon i,
.telegram-icon svg {
    width: 20px;
    height: 20px;
    color: #0088cc;
}

.telegram-block.connected .telegram-icon i,
.telegram-block.connected .telegram-icon svg {
    color: var(--color-success, #10B981);
}

.telegram-content {
    flex: 1;
    min-width: 0;
}

.telegram-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #1A1A1A);
    margin: 0 0 2px 0;
}

.telegram-description {
    font-size: 0.8rem;
    color: var(--text-muted, #999999);
    margin: 0;
}

.telegram-username {
    color: var(--color-success, #10B981);
    font-weight: 500;
}

.telegram-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ============================================
   NOTIFICATION SETTINGS
   ============================================ */

.notification-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-secondary, #F5F5F5);
    border-radius: var(--radius-md, 8px);
    margin-bottom: 10px;
}

.notification-toggle-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary, #1A1A1A);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #D1D5DB;
    border-radius: 24px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-gold, #FFD700);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.notification-frequency {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-frequency-label {
    font-size: 0.8rem;
    color: var(--text-muted, #999999);
}

.frequency-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    outline: none;
}

.frequency-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-gold, #FFD700);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.frequency-value {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted, #999999);
    margin-top: 2px;
}

/* ============================================
   BUTTONS
   ============================================ */

.profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md, 8px);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body, 'Inter', sans-serif);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-height: 36px;
    white-space: nowrap;
}

.profile-btn i,
.profile-btn svg {
    width: 16px;
    height: 16px;
}

.profile-btn-primary {
    background: var(--gradient-gold, linear-gradient(135deg, #FFD700, #FFA500));
    color: var(--text-primary, #1A1A1A);
    box-shadow: var(--shadow-gold, 0 4px 15px rgba(255, 215, 0, 0.3));
}

.profile-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.profile-btn-secondary {
    background: var(--bg-secondary, #F5F5F5);
    color: var(--text-primary, #1A1A1A);
    border: 1px solid #E5E7EB;
}

.profile-btn-secondary:hover {
    background: #E5E7EB;
}

.profile-btn-danger {
    background: rgba(239, 68, 68, 0.08);
    color: var(--color-error, #EF4444);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.profile-btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.profile-btn-telegram {
    background: #0088cc;
    color: #fff;
}

.profile-btn-telegram:hover {
    background: #0077b5;
}

.profile-btn-success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--color-success, #10B981);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.profile-btn-success:hover {
    background: rgba(16, 185, 129, 0.15);
}

.profile-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   AUTH PROMPT (когда не залогинен)
   ============================================ */

.profile-auth-prompt {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 420px;
    margin: 1rem auto;
}

.profile-auth-icon {
    margin-bottom: 1rem;
}

.profile-auth-icon i,
.profile-auth-icon svg {
    width: 64px;
    height: 64px;
    color: var(--color-gold, #FFD700);
    opacity: 0.7;
}

.profile-auth-title {
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary, #1A1A1A) !important;
    margin-bottom: 0.5rem;
}

.profile-auth-description {
    color: var(--text-muted, #999999);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.profile-auth-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.profile-auth-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-card, #FFFFFF);
    border-radius: var(--radius-md, 8px);
    border: 1px solid #E5E7EB;
    font-size: 0.8rem;
    color: var(--text-primary, #1A1A1A);
}

.profile-auth-feature i,
.profile-auth-feature svg {
    width: 16px;
    height: 16px;
    color: var(--color-gold, #FFD700);
    flex-shrink: 0;
}

.profile-auth-btn {
    width: 100%;
    padding: 10px 20px;
    font-size: 0.95rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }

    .profile-form-row {
        grid-template-columns: 1fr;
    }

    .telegram-block {
        flex-direction: column;
        text-align: center;
    }

    .telegram-actions {
        width: 100%;
    }

    .telegram-actions .profile-btn {
        flex: 1;
    }

    .profile-btn-full-mobile {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-avatar img {
        width: 56px;
        height: 56px;
    }

    .profile-name {
        font-size: 1.2rem;
    }

    .profile-section {
        padding: 10px;
    }

    .profile-auth-features {
        grid-template-columns: 1fr;
    }

    .profile-auth-prompt {
        padding: 2rem 1rem;
    }
}
