/* Account Page Styles - Mac Inspired Design */

/* ===== SUBTLE ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.account-page {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 4rem;
    background: var(--bg-primary);
}

/* ===== AUTH SECTION ===== */
.auth-section {
    max-width: 420px;
    margin: 2rem auto;
    animation: fadeInUp 0.5s ease-out;
}

.auth-container {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
}

.auth-tabs {
    display: flex;
    padding: 6px;
    margin: 12px;
    background: var(--bg-elevated);
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-form {
    display: none;
    padding: 1.5rem 2rem 2rem;
}

.auth-form.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.auth-form h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.75rem;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.12);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group input:disabled {
    background: var(--bg-elevated);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.required {
    color: #ff3b30;
}

.form-error {
    color: #ff3b30;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 59, 48, 0.08);
    border-radius: 10px;
    display: none;
}

.form-error.show {
    display: block;
}

.form-message {
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    display: none;
}

.form-message.success {
    display: block;
    color: #34c759;
    background: rgba(52, 199, 89, 0.08);
}

.form-message.error {
    display: block;
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.08);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #0095d0;
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-danger {
    background: #ff3b30;
    color: white;
}

.btn-danger:hover {
    background: #e0342b;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

/* ===== DASHBOARD SECTION ===== */
.dashboard-section {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-subtle);
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #007AFF, #5856D6);
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-info h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.profile-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Dashboard Navigation */
.dashboard-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 1.5rem;
    background: var(--bg-elevated);
    border-radius: 12px;
}

.dash-tab {
    flex: 1;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dash-tab:hover {
    color: var(--text-primary);
}

.dash-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dash-content {
    display: none;
}

.dash-content.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* ===== CONTENT CARDS ===== */
.content-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-subtle);
}

.content-card h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h3 {
    margin-bottom: 0;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

@media (max-width: 500px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== ORDERS LIST ===== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-card {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.order-card:hover {
    border-color: var(--border-medium);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-elevated);
}

.order-number {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.order-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-left: 0.75rem;
}

.order-status {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.order-status.pending {
    background: rgba(255, 149, 0, 0.12);
    color: #ff9500;
}

.order-status.processing {
    background: rgba(0, 122, 255, 0.12);
    color: #007aff;
}

.order-status.shipped {
    background: rgba(88, 86, 214, 0.12);
    color: #5856d6;
}

.order-status.completed {
    background: rgba(52, 199, 89, 0.12);
    color: #34c759;
}

.order-status.cancelled {
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
}

.order-body {
    padding: 1rem;
}

.order-items {
    margin-bottom: 0.75rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.order-item-name {
    color: var(--text-primary);
}

.order-item-qty {
    color: var(--text-secondary);
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9375rem;
}

/* ===== ADDRESSES GRID ===== */
.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.address-card {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.address-card:hover {
    border-color: var(--border-medium);
}

.address-card.default {
    border-color: var(--accent-blue);
    background: rgba(0, 122, 255, 0.02);
}

.address-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.address-label span {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.default-badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    background: var(--accent-blue);
    color: white;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.address-details {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.875rem;
}

.address-actions {
    display: flex;
    gap: 0.5rem;
}

.address-actions button {
    flex: 1;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.875rem;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

/* ===== LOADING ===== */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-content form {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .account-page {
        padding-top: 80px;
    }

    .auth-section {
        margin: 1rem;
    }

    .auth-form {
        padding: 1.25rem 1.5rem 1.5rem;
    }

    .profile-header {
        flex-wrap: wrap;
    }

    .profile-header .btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    .dashboard-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dash-tab {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .addresses-grid {
        grid-template-columns: 1fr;
    }
}
