/* =========================================
   ERMI DATA — ACCOUNT LAYOUT STYLES
   Стили для навбара, сайдбара, футера, дропдауна
   ========================================= */

/* ===== LAYOUT WRAPPER ===== */
.ed-account-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--ed-bg-primary);
}

/* ===== BACKGROUND GRID PATTERN ===== */
.ed-bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

.ed-bg-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
}

/* ===== GLASS EFFECT ===== */
.ed-glass {
    background: rgba(20, 20, 32, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ed-glass-strong {
    background: rgba(20, 20, 32, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== GLOW BORDER ===== */
.ed-glow-border {
    position: relative;
}

.ed-glow-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(139, 92, 246, 0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.ed-glow-border:hover::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.6), rgba(139, 92, 246, 0.6));
}

/* ===== GRADIENT TEXT ===== */
.ed-gradient-text {
    background: var(--ed-accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== TOP NAVBAR ===== */
.ed-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--ed-z-navbar);
    background: var(--ed-bg-navbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ed-border-color);
    height: 64px;
}

.ed-navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--ed-spacing-xl);
    height: 100%;
    gap: var(--ed-spacing-xl);
}

/* Navbar right section */
.ed-navbar-right {
    display: flex;
    align-items: center;
    gap: var(--ed-spacing-md);
    flex-shrink: 0;
}

/* Mobile hamburger button */
.ed-navbar-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--ed-border-color);
    border-radius: var(--ed-radius-md);
    color: var(--ed-text-secondary);
    cursor: pointer;
    transition: all var(--ed-transition-fast);
}

.ed-navbar-hamburger:hover {
    color: var(--ed-text-primary);
    border-color: var(--ed-border-light);
    background: rgba(255, 255, 255, 0.03);
}

/* Brand / Logo */
.ed-navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.ed-navbar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Center Navigation Links */
.ed-navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--ed-spacing-xs);
    flex: 1;
    justify-content: center;
}

.ed-navbar-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    color: var(--ed-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--ed-radius-md);
    transition: all var(--ed-transition-fast);
    white-space: nowrap;
}

.ed-navbar-link:hover {
    color: var(--ed-text-primary);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.ed-navbar-link.active {
    color: var(--ed-accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.ed-navbar-link i {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

/* ===== USER DROPDOWN ===== */
.ed-user-dropdown {
    position: relative;
}

.ed-user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0.375rem 0.625rem 0.375rem 0.375rem;
    border-radius: var(--ed-radius-full);
    transition: all var(--ed-transition-fast);
}

.ed-user-dropdown-toggle:hover {
    border-color: var(--ed-border-light);
    background: rgba(255, 255, 255, 0.03);
}

.ed-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ed-accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.ed-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ed-text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ed-user-chevron {
    font-size: 0.7rem;
    color: var(--ed-text-muted);
    transition: transform var(--ed-transition-fast);
}

.ed-user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--ed-bg-card);
    border: 1px solid var(--ed-border-light);
    border-radius: var(--ed-radius-lg);
    box-shadow: var(--ed-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--ed-transition-fast);
    z-index: var(--ed-z-dropdown);
}

.ed-dropdown-show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.ed-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--ed-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--ed-transition-fast);
}

.ed-user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--ed-text-primary);
    text-decoration: none;
}

.ed-user-dropdown-item.active {
    color: var(--ed-accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.ed-user-dropdown-item.ed-user-dropdown-logout {
    color: var(--ed-danger);
    border-top: 1px solid var(--ed-border-color);
    border-radius: 0;
    margin-top: 4px;
}

.ed-user-dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

.ed-user-dropdown-divider {
    height: 1px;
    background: var(--ed-border-color);
    margin: 4px 0;
}

/* ===== SIDEBAR ===== */
.ed-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 240px;
    z-index: var(--ed-z-sidebar);
    background: var(--ed-bg-sidebar);
    border-right: 1px solid var(--ed-border-color);
    overflow-y: auto;
    transition: transform var(--ed-transition-base);
}

.ed-sidebar-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: var(--ed-spacing-lg) 0;
}

.ed-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--ed-spacing-md);
    flex: 1;
}

.ed-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem var(--ed-spacing-md);
    color: var(--ed-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--ed-radius-md);
    transition: all var(--ed-transition-fast);
    position: relative;
}

.ed-sidebar-link:hover {
    color: var(--ed-text-primary);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.ed-sidebar-link.active {
    color: var(--ed-accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.ed-sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--ed-accent-gradient);
    border-radius: 0 3px 3px 0;
}

.ed-sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Sidebar divider between sections */
.ed-sidebar-divider {
    height: 1px;
    background: var(--ed-border-color);
    margin: var(--ed-spacing-md) var(--ed-spacing-md);
}

/* Sidebar footer */
.ed-sidebar-footer {
    padding: var(--ed-spacing-md) var(--ed-spacing-md) var(--ed-spacing-lg);
    border-top: 1px solid var(--ed-border-color);
    margin-top: auto;
}

.ed-sidebar-trial-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--ed-radius-md);
    font-size: 0.75rem;
    color: var(--ed-success);
    font-weight: 500;
}

.ed-pulse-small {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ed-success);
    animation: edPulse 2s ease-in-out infinite;
}

@keyframes edPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Sidebar link with stub indicator */
.ed-sidebar-link[data-stub="true"] {
    cursor: not-allowed;
    opacity: 0.6;
}

.ed-sidebar-link[data-stub="true"]:hover {
    background: transparent;
    color: var(--ed-text-secondary);
}

.ed-sidebar-link[data-stub="true"] .ed-stub-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ed-border-color);
    border-radius: var(--ed-radius-sm);
    color: var(--ed-text-muted);
    margin-left: auto;
    white-space: nowrap;
}

/* AI section special styling */
.ed-sidebar-section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--ed-spacing-md) var(--ed-spacing-md) var(--ed-spacing-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ed-text-muted);
}

.ed-sidebar-section-label i {
    font-size: 0.8rem;
    color: var(--ed-accent-purple);
}

/* ===== MOBILE OVERLAY ===== */
.ed-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 64px;
    background: rgba(0, 0, 0, 0.6);
    z-index: calc(var(--ed-z-sidebar) - 1);
    backdrop-filter: blur(4px);
}

.ed-sidebar-visible {
    display: block !important;
}

/* ===== MAIN CONTENT ===== */
.ed-main-content {
    margin-left: 240px;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.ed-main-content-full {
    margin-left: 0;
}

.ed-content-wrapper {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: var(--ed-spacing-2xl) var(--ed-spacing-xl);
    position: relative;
    z-index: 1;
}

/* ===== FOOTER ===== */
.ed-account-footer {
    background: var(--ed-bg-secondary);
    border-top: 1px solid var(--ed-border-color);
    padding: var(--ed-spacing-xl) 0;
    margin-top: auto;
}

.ed-account-footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--ed-spacing-xl);
}

.ed-account-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ed-spacing-lg);
    justify-content: center;
    margin-bottom: var(--ed-spacing-lg);
}

.ed-account-footer-links a {
    color: var(--ed-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--ed-transition-fast);
}

.ed-account-footer-links a:hover {
    color: var(--ed-text-secondary);
    text-decoration: none;
}

.ed-account-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ed-spacing-lg);
    padding-top: var(--ed-spacing-lg);
    border-top: 1px solid var(--ed-border-color);
}

.ed-account-footer-bottom p {
    margin: 0;
    color: var(--ed-text-muted);
    font-size: 0.8rem;
}

.ed-account-footer-socials {
    display: flex;
    gap: var(--ed-spacing-md);
}

.ed-account-footer-socials a {
    color: var(--ed-text-muted);
    transition: all var(--ed-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--ed-radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ed-border-color);
}

.ed-account-footer-socials a:hover {
    color: var(--ed-accent-blue);
    border-color: var(--ed-accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .ed-navbar-nav {
        display: none;
    }

    .ed-navbar-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ed-user-name {
        display: none;
    }

    .ed-sidebar {
        transform: translateX(-100%);
    }

    .ed-sidebar-open {
        transform: translateX(0) !important;
    }

    .ed-main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .ed-content-wrapper {
        padding: var(--ed-spacing-xl) var(--ed-spacing-md);
    }

    .ed-account-footer-links {
        flex-direction: column;
        align-items: center;
        gap: var(--ed-spacing-sm);
    }

    .ed-account-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 550px) {
    /* Fix content shift: ensure proper centering and no overflow */
    .ed-content-wrapper {
        padding: var(--ed-spacing-lg) 0;
        max-width: 100%;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .ed-main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    .ed-account-footer-container {
        padding: 0 var(--ed-spacing-sm);
    }

    /* Force full-width for account layout */
    .ed-account-layout {
        width: 100%;
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .ed-navbar-container {
        padding: 0 var(--ed-spacing-md);
    }

    .ed-user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.6rem;
    }
}

/* ===== PAGE HEADER ===== */
.ed-page-header {
    margin-bottom: var(--ed-spacing-2xl);
}

.ed-page-header-container {
    max-width: 800px;
}

.ed-page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 var(--ed-spacing-sm);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ed-text-primary);
    letter-spacing: -0.02em;
}

.ed-page-title i {
    color: var(--ed-accent-blue);
    font-size: 1.5rem;
}

.ed-page-subtitle {
    margin: 0;
    color: var(--ed-text-secondary);
    font-size: 1rem;
}

/* ===== CONTENT AREA ===== */
.ed-content-area {
    max-width: 800px;
}

.ed-content-grid {
    display: flex;
    flex-direction: column;
    gap: var(--ed-spacing-xl);
}

.ed-col-main {
    width: 100%;
}

/* ===== FORM STYLES ===== */
.ed-form-group {
    margin-bottom: var(--ed-spacing-lg);
}

.ed-field-wrapper {
    position: relative;
}

.ed-field-hint {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.ed-field-hint a {
    color: var(--ed-accent-blue);
    text-decoration: none;
    transition: color var(--ed-transition-fast);
}

.ed-field-hint a:hover {
    color: var(--ed-accent-purple);
    text-decoration: underline;
}

/* Password toggle */
.ed-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.ed-pwd-toggle-btn {
    background: none;
    border: none;
    color: var(--ed-text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    transition: color var(--ed-transition-fast);
}

.ed-pwd-toggle-btn:hover {
    color: var(--ed-text-secondary);
}

/* Form actions */
.ed-form-actions {
    margin-top: var(--ed-spacing-xl);
}

.ed-btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Card variants */
.ed-card-warning {
    border-color: rgba(245, 158, 11, 0.2);
}

.ed-card-warning .ed-card-header {
    background: rgba(245, 158, 11, 0.05);
}

.ed-card-warning .ed-card-header i {
    color: var(--ed-warning);
}

/* Success alert */
.ed-alert-success {
    background: var(--ed-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--ed-radius-lg);
    padding: var(--ed-spacing-lg) var(--ed-spacing-xl);
    display: flex;
    align-items: flex-start;
    gap: var(--ed-spacing-md);
    margin-bottom: var(--ed-spacing-xl);
}

.ed-alert-icon {
    font-size: 1.25rem;
    color: var(--ed-success);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.ed-alert-content {
    color: var(--ed-success);
    font-size: 0.9rem;
}

.ed-alert-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* ===== SECTION HEADING ===== */
.ed-section-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--ed-spacing-lg);
    padding-bottom: var(--ed-spacing-md);
    border-bottom: 1px solid var(--ed-border-color);
}

.ed-section-heading-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--ed-radius-md);
    color: var(--ed-accent-blue);
    font-size: 1rem;
}

.ed-section-heading h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ed-text-primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .ed-page-title {
        font-size: 1.5rem;
    }

    .ed-content-area {
        padding: 0 var(--ed-spacing-md);
    }
}