/* ═══════════════════════════════════════════════════════════════════
   TRENDRONIC — AUTH SYSTEM STYLES
   Enhanced popup, user dropdown, OTP, password strength, alerts
   ═══════════════════════════════════════════════════════════════════ */

/* ─── UTILITY ──────────────────────────────────────────────────── */
.text-primary-custom {
    color: var(--primary-color) !important;
}

/* ─── USER AVATAR IN HEADER ────────────────────────────────────── */
.user-avatar-header {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-avatar-header:hover {
    box-shadow: 0 0 0 3px rgba(0, 78, 130, 0.2);
    transform: scale(1.05);
}

/* ─── ENHANCED USER DROPDOWN ──────────────────────────────────── */
.user-dropdown-enhanced {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    min-width: 240px;
    padding: 16px;
    display: none;
    z-index: 10001;
    opacity: 0;
    transform: translateY(-8px);
    animation: dropdownSlideIn 0.25s ease forwards;
}

.user-wrapper:hover .user-dropdown-enhanced,
.user-dropdown-enhanced.show {
    display: block;
}

@keyframes dropdownSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown arrow */
.user-dropdown-enhanced::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 2px;
    transform: rotate(45deg);
    box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.04);
}

.ud-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
}

.ud-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eef4f9;
}

.ud-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1a1a;
}

.ud-email {
    font-size: 0.78rem;
    color: #888;
    direction: ltr;
    text-align: left;
}

.ud-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 0;
}

.ud-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #444;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ud-link:hover {
    background: #f4f8fb;
    color: var(--primary-color);
}

.ud-link i {
    font-size: 0.85rem;
    width: 18px;
    text-align: center;
    color: var(--primary-color);
}

.ud-logout {
    color: #d32f2f;
}

.ud-logout:hover {
    background: #fef2f2;
    color: #b71c1c;
}

.ud-logout i {
    color: #d32f2f;
}

/* ─── AUTH POPUP ENHANCEMENTS ─────────────────────────────────── */

/* Form input enhancements */
.auth-popup-content .form-control-custom {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 12px 45px 12px 45px;
    font-size: 0.92rem;
    transition: all 0.3s ease;
    font-family: 'Cairo', 'Alexandria', sans-serif;
}

.auth-popup-content .form-control-custom:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 78, 130, 0.08);
    outline: none;
}

.auth-popup-content .form-control-custom.input-error {
    border-color: #e53935;
    background: #fff5f5;
}

.auth-popup-content .form-control-custom.input-success {
    border-color: #43a047;
    background: #f5fff5;
}

/* ─── TOGGLE PASSWORD BUTTON ──────────────────────────────────── */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: color 0.2s;
    z-index: 2;
}

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

/* ─── AUTH ALERT MESSAGES ─────────────────────────────────────── */
.auth-alert {
    display: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
    animation: alertSlideIn 0.3s ease;
}

.auth-alert.show {
    display: block;
}

.auth-alert.alert-error {
    background: #fef2f2;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.auth-alert.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.auth-alert.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── PASSWORD STRENGTH BAR ───────────────────────────────────── */
.password-strength-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: all 0.4s ease;
}

.strength-fill.weak {
    width: 25%;
    background: #e53935;
}

.strength-fill.fair {
    width: 50%;
    background: #fb8c00;
}

.strength-fill.good {
    width: 75%;
    background: #43a047;
}

.strength-fill.strong {
    width: 100%;
    background: linear-gradient(90deg, #43a047, #1b5e20);
}

.strength-text {
    font-size: 0.75rem;
    margin-top: 4px;
    display: block;
}

/* ─── CUSTOM CHECKBOX ─────────────────────────────────────────── */
.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.custom-checkbox:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

/* ─── SUBMIT BUTTON LOADING STATE ─────────────────────────────── */
.auth-submit-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 48px;
}

.auth-submit-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.auth-submit-btn .spinner-border {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.auth-submit-btn.loading .btn-text,
.auth-submit-btn.loading .btn-icon {
    display: none;
}

.auth-submit-btn.loading .spinner-border {
    display: inline-block !important;
}

/* ─── OTP INPUTS ──────────────────────────────────────────────── */
.otp-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.otp-digit {
    width: 52px;
    height: 58px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    font-family: 'Cairo', monospace;
    color: var(--primary-color);
}

.otp-digit:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 78, 130, 0.1);
    outline: none;
    transform: scale(1.05);
}

.otp-digit.filled {
    border-color: var(--primary-color);
    background: #eaf4fb;
}

.otp-email-display {
    color: var(--primary-color);
    font-size: 0.9rem;
    direction: ltr;
}

/* ─── BACK LINK ───────────────────────────────────────────────── */
.btn-back-link {
    background: none;
    border: none;
    color: #777;
    font-size: 0.88rem;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
    font-family: 'Cairo', 'Alexandria', sans-serif;
}

.btn-back-link:hover {
    color: var(--primary-color);
}

/* ─── POPUP SCROLL FIX ────────────────────────────────────────── */
.auth-popup-box {
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.auth-popup-box::-webkit-scrollbar {
    width: 4px;
}

.auth-popup-box::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* ─── SUCCESS ANIMATION ───────────────────────────────────────── */
.auth-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-success-icon i {
    font-size: 2rem;
    color: #2e7d32;
}

@keyframes successPop {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ─── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 576px) {
    .auth-popup-box {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }

    .otp-digit {
        width: 44px;
        height: 50px;
        font-size: 1.2rem;
    }

    .user-dropdown-enhanced {
        min-width: 200px;
        left: -10px;
    }
}

@media (max-width: 768px) {
    .user-dropdown-enhanced {
        position: fixed;
        top: unset;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        min-width: unset;
        animation: dropdownSlideUp 0.3s ease forwards;
    }

    .user-dropdown-enhanced::before {
        display: none;
    }

    @keyframes dropdownSlideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ═══════════════════════════════════════════════════════════════════
   MY ACCOUNT — TWO-COLUMN RTL LAYOUT
   ═══════════════════════════════════════════════════════════════════ */

/* ─── WRAPPER ──────────────────────────────────────────────────── */
.trendronic-myaccount-wrapper {
    padding: 40px 0;
    font-family: 'Cairo', 'Alexandria', sans-serif;
}

.myaccount-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    direction: rtl;
}

/* ─── SIDEBAR ──────────────────────────────────────────────────── */
.myaccount-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.sidebar-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eef4f9;
}

.sidebar-user-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.sidebar-user-email {
    font-size: 0.8rem;
    color: #888;
    margin: 2px 0 0;
    direction: ltr;
    text-align: left;
}

/* ─── NAVIGATION ───────────────────────────────────────────────── */
.myaccount-nav {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.myaccount-nav-list {
    list-style: none;
    margin: 0;
    padding: 8px;
}

.myaccount-nav-item {
    margin: 2px 0;
}

.myaccount-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #555;
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.myaccount-nav-link:hover {
    background: #f4f8fb;
    color: var(--primary-color);
}

.myaccount-nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--primary-color);
    opacity: 0.7;
}

/* Active state */
.myaccount-nav-item.is-active .myaccount-nav-link {
    background: linear-gradient(135deg, #eaf4fb, #d6eaf8);
    color: var(--primary-color);
    font-weight: 700;
}

.myaccount-nav-item.is-active .myaccount-nav-link .nav-icon {
    opacity: 1;
}

/* Logout link */
.nav-logout {
    color: #d32f2f !important;
}

.nav-logout:hover {
    background: #fef2f2 !important;
}

.nav-logout .nav-icon {
    color: #d32f2f !important;
}

/* ─── CONTENT AREA ─────────────────────────────────────────────── */
.myaccount-content {
    min-height: 400px;
}

/* ─── DASHBOARD ────────────────────────────────────────────────── */
.dashboard-welcome h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #eaf4fb, #d6eaf8);
    color: var(--primary-color);
}

.stat-pending .stat-icon {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #e65100;
}

.stat-account .stat-icon {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
}

.stat-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
}

.stat-label {
    font-size: 0.82rem;
    color: #888;
    margin-top: 4px;
}

/* ─── ORDERS TABLE ─────────────────────────────────────────────── */
.dashboard-recent-orders,
.myaccount-section-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.section-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.section-card-title i {
    color: var(--primary-color);
    margin-left: 8px;
}

.orders-table-wrapper {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-align: right;
    border-bottom: 2px solid #eee;
}

.orders-table td {
    padding: 12px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.orders-table a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.orders-table a:hover {
    text-decoration: underline;
}

.order-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-processing {
    background: #e3f2fd;
    color: #1565c0;
}

.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-pending, .status-on-hold {
    background: #fff3e0;
    color: #e65100;
}

.status-cancelled, .status-failed, .status-refunded {
    background: #fef2f2;
    color: #c62828;
}

/* ─── QUICK LINKS ──────────────────────────────────────────────── */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.quick-link-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #555;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.quick-link-card:hover {
    background: #eaf4fb;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-link-card i {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.quick-link-card span {
    font-size: 0.88rem;
    font-weight: 600;
}

/* ─── CHANGE PASSWORD FORM (inside my account) ────────────────── */
.change-password-form .form-control-custom {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 12px 45px 12px 45px;
    font-size: 0.92rem;
    transition: all 0.3s ease;
    font-family: 'Cairo', 'Alexandria', sans-serif;
    width: 100%;
}

.change-password-form .form-control-custom:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 78, 130, 0.08);
    outline: none;
}

.change-password-form .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.change-password-form .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    z-index: 2;
}

/* ─── RESPONSIVE MY ACCOUNT ───────────────────────────────────── */
@media (max-width: 768px) {
    .myaccount-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .myaccount-sidebar {
        position: relative;
        top: 0;
    }

    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-links-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .orders-table th,
    .orders-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
}

@media (max-width: 576px) {
    .quick-links-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-user-card {
        padding: 16px;
    }
}

