/* ====================================
   MODERN EDIT PROFILE - PREMIUM DESIGN
   ==================================== */

/* ====================================
   RESET & BASE
   ==================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color System - Professional Palette */
    --primary-50:  #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-300: #6ee7b7;
    --primary-400: #34d399;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-800: #065f46;

    --neutral-50:  #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;

    --error-50:  #fef2f2;
    --error-500: #ef4444;
    --error-600: #dc2626;

    --success-50:  #ecfdf5;
    --success-500: #10b981;
    --success-600: #059669;

    --warning-50:  #fffbeb;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing Scale */
    --spacing-xs:  0.25rem;  /* 4px */
    --spacing-sm:  0.5rem;   /* 8px */
    --spacing-md:  1rem;     /* 16px */
    --spacing-lg:  1.5rem;   /* 24px */
    --spacing-xl:  2rem;     /* 32px */
    --spacing-2xl: 3rem;     /* 48px */

    /* Border Radius */
    --radius-sm:  0.375rem;  /* 6px */
    --radius-md:  0.5rem;    /* 8px */
    --radius-lg:  0.75rem;   /* 12px */
    --radius-xl:  1rem;      /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;

    /* Shadows - Modern elevation system */
    --shadow-xs:  0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm:  0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--neutral-50);
    color: var(--neutral-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ====================================
   HEADER
   ==================================== */
.profile-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--neutral-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.profile-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    gap: var(--spacing-md);
}

.profile-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--neutral-900);
    flex: 1;
    text-align: center;
    letter-spacing: -0.025em;
}

.back-btn,
.save-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.back-btn {
    color: var(--neutral-600);
}

.back-btn:hover {
    color: var(--neutral-900);
    background: var(--neutral-100);
}

.back-btn:active {
    transform: scale(0.98);
}

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

.save-btn {
    color: var(--primary-600);
    font-weight: 600;
}

.save-btn:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

.save-btn:active {
    transform: scale(0.98);
}

.save-btn i {
    font-size: 0.875rem;
}

/* ====================================
   MAIN CONTENT
   ==================================== */
.profile-content {
    padding: var(--spacing-xl) 0 6rem;
}

/* ====================================
   PROFILE PICTURE SECTION
   ==================================== */
.profile-picture-section {
    background: #ffffff;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-2xl) var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.picture-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.picture-ring {
    position: relative;
    width: 136px;
    height: 136px;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    box-shadow: var(--shadow-md);
}

.picture-container {
    position: relative;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    background: #ffffff;
    cursor: pointer;
    transition: transform var(--transition-base);
}

.picture-container:hover {
    transform: scale(1.02);
}

.picture-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.picture-container:hover img {
    transform: scale(1.1);
}

.picture-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: var(--spacing-lg);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.picture-container:hover .picture-overlay {
    opacity: 1;
}

.picture-overlay i {
    color: #ffffff;
    font-size: 1.25rem;
}

.change-photo-btn {
    background: var(--neutral-900);
    color: #ffffff;
    border: none;
    padding: 0.625rem 1.75rem;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.change-photo-btn:hover {
    background: var(--neutral-800);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.change-photo-btn:active {
    transform: translateY(0);
}

.change-photo-btn i {
    font-size: 0.875rem;
}

/* ====================================
   FORM SECTIONS
   ==================================== */
.form-section {
    background: #ffffff;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section:nth-child(2) { animation-delay: 0.05s; }
.form-section:nth-child(3) { animation-delay: 0.1s; }
.form-section:nth-child(4) { animation-delay: 0.15s; }
.form-section:nth-child(5) { animation-delay: 0.2s; }
.form-section:nth-child(6) { animation-delay: 0.25s; }

.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--neutral-900);
    letter-spacing: -0.025em;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--neutral-100);
}

.section-title .icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    background: var(--primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-title .icon-wrap i {
    color: var(--primary-600);
    font-size: 1rem;
}

/* ====================================
   FORM ELEMENTS
   ==================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--neutral-700);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.01em;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--neutral-400);
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--transition-fast);
    z-index: 1;
}

.form-group:focus-within .input-icon {
    color: var(--primary-500);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1.5px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--neutral-900);
    background: #ffffff;
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder {
    color: var(--neutral-400);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--neutral-300);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.form-group textarea {
    padding-left: 1rem;
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Select Styling */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a3a3a3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 3rem;
    cursor: pointer;
}

/* Readonly/Disabled State */
.form-group input[readonly],
.form-group input:disabled {
    background: var(--neutral-50);
    color: var(--neutral-500);
    cursor: not-allowed;
    border-color: var(--neutral-200);
}

.form-group input[readonly]:focus,
.form-group input:disabled:focus {
    border-color: var(--neutral-200);
    box-shadow: none;
}

/* Username Display */
.username-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1rem;
    background: var(--neutral-50);
    border: 1.5px solid var(--neutral-200);
    border-radius: var(--radius-lg);
}

.username-display .at-sign {
    color: var(--primary-600);
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.username-display .username-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--neutral-700);
}

/* Character Counter */
.meta-row {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--spacing-sm);
}

.char-count {
    font-size: 0.8125rem;
    color: var(--neutral-400);
    font-weight: 500;
}

/* Form Hint */
.form-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--neutral-500);
    margin-top: var(--spacing-sm);
    line-height: 1.4;
}

.form-hint i {
    font-size: 0.75rem;
    color: var(--neutral-400);
}

/* Password Toggle */
.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--neutral-400);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all var(--transition-fast);
    z-index: 2;
}

.toggle-password:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

/* Verification Badge */
.verify-badge {
    position: absolute;
    right: 0.75rem;
    display: none;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success-600);
    background: var(--success-50);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    z-index: 2;
}

.verify-badge.show {
    display: flex;
}

.verify-badge i {
    font-size: 0.875rem;
}

/* ====================================
   SECURITY NOTE
   ==================================== */
.security-note {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    background: var(--warning-50);
    border: 1px solid var(--warning-500);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.security-note .note-icon {
    color: var(--warning-600);
    font-size: 1.125rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.security-note p {
    font-size: 0.875rem;
    color: var(--neutral-700);
    line-height: 1.5;
}

/* ====================================
   ACTION BUTTONS
   ==================================== */
.action-section {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary i {
    font-size: 1rem;
}

.btn-secondary {
    background: #ffffff;
    color: var(--neutral-700);
    border: 1.5px solid var(--neutral-300);
}

.btn-secondary:hover {
    border-color: var(--neutral-400);
    color: var(--neutral-900);
    background: var(--neutral-50);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-secondary i {
    font-size: 0.875rem;
}

/* ====================================
   LOADING OVERLAY
   ==================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--spacing-lg);
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ====================================
   TOAST NOTIFICATIONS
   ==================================== */
.toast-container {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 90%;
    max-width: 420px;
    pointer-events: none;
}

.toast-message {
    background: var(--neutral-900);
    color: #ffffff;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-base);
    pointer-events: auto;
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-message.success {
    background: var(--success-600);
}

.toast-message.error {
    background: var(--error-600);
}

.toast-message i {
    font-size: 1.125rem;
    flex-shrink: 0;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-section {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .profile-content {
        padding: var(--spacing-lg) 0 5rem;
    }
    
    .profile-header h1 {
        font-size: 1.125rem;
    }
    
    .save-btn span {
        display: none;
    }
    
    .action-section {
        flex-direction: column;
    }
    
    .picture-ring {
        width: 116px;
        height: 116px;
    }
    
    .picture-container {
        width: 110px;
        height: 110px;
    }
    
    .profile-picture-section {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
}

/* ====================================
   ACCESSIBILITY
   ==================================== */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ====================================
   HIDDEN COMPATIBILITY ELEMENTS
   ==================================== */
.overlay,
.bottom-sheet {
    display: none;
}
