/* Account Page Styles */

/* Ensure header container is properly displayed */
#header-container {
    position: relative;
    z-index: 1030;
    width: 100%;
}

#header-container .header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1030 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#header-container .header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.account-page {
    padding: 120px 0 40px 0;
    background: #f8fafc;
    min-height: 100vh;
    position: relative;
    margin-top: 0;
}

/* Scope container to only account page content, not header/footer */
.account-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.account-header {
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 10px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 14px;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #1d4ed8;
}

.breadcrumb .separator {
    color: #94a3b8;
}

.breadcrumb .current {
    color: #64748b;
    font-weight: 500;
}

/* Loading state: shown until user data and backend are ready */
.account-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 1rem;
}
.account-loading p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}
.account-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: account-spin 0.8s linear infinite;
}
@keyframes account-spin {
    to { transform: rotate(360deg); }
}
.account-content.loaded .account-loading {
    display: none;
}
.account-content:not(.loaded) .account-nav,
.account-content:not(.loaded) .account-section {
    display: none !important;
}

.account-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
}

/* Account Navigation */
.account-nav {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    height: fit-content;
}

.nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    border: none;
    background: none;
    color: #6b7280;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.nav-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.nav-btn.active {
    background: #1e3a8a;
    color: white;
}

.nav-btn:last-child {
    margin-bottom: 0;
}

/* Account Sections */
.account-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    display: none;
}

.account-section.active {
    display: block;
}

.account-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 30px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 15px;
}

.account-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin: 30px 0 15px 0;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 8px;
}

.account-section h3:first-child {
    margin-top: 0;
}

/* Form Styles */
.account-form {
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.12);
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.checkbox-container input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #1e3a8a;
}

.checkbox-container label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    margin: 0;
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

/* Scope button styles to account page only */
.account-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.account-page .btn-primary {
    background: #1e3a8a;
    color: white;
}

.account-page .btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

/* Orders Section */
.order-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #e5e7eb;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.order-id {
    font-weight: 600;
    color: #1e3a8a;
    font-size: 16px;
}

.order-date {
    color: #6b7280;
    font-size: 14px;
}

.order-status {
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.order-total {
    text-align: right;
    font-weight: 600;
    color: #10b981;
    font-size: 16px;
}

.order-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.account-page .btn-outline {
    background: transparent;
    color: #1e3a8a;
    border: 1px solid #1e3a8a;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
}

.account-page .btn-outline:hover {
    background: #1e3a8a;
    color: white;
}

.account-page .btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 30px;
}

/* Order Items */
.order-items {
    margin-top: 15px;
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.order-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.item-quantity {
    font-size: 12px;
    color: #6b7280;
}

.item-price {
    font-weight: 600;
    color: #10b981;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .account-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .account-nav {
        order: 1;
    }

    .account-nav {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    }

    .nav-btn {
        flex-shrink: 0;
        white-space: nowrap;
        margin-bottom: 0;
        padding: 10px 16px;
        font-size: 14px;
    }

    .account-section {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .order-total {
        text-align: left;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .account-page .container {
        padding: 0 15px;
    }

    .account-section {
        padding: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .order-card {
        padding: 15px;
    }
}
