/**
 * IAStriker User Sidebar - Shared Styles
 */

:root {
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --purple-500: #8b5cf6;
    --purple-600: #7c3aed;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --red-500: #ef4444;
    --yellow-500: #eab308;
    --orange-500: #f97316;
}

/* Sidebar Container */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: 1.5rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    text-decoration: none;
}

.logo-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    background: linear-gradient(135deg, var(--blue-500), var(--purple-500));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, var(--blue-500), var(--purple-500));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 12px;
    color: var(--gray-500);
}

.plan-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-free { background: var(--gray-100); color: var(--gray-600); }
.plan-pro { background: rgba(59, 130, 246, 0.1); color: var(--blue-600); }
.plan-vip { background: rgba(139, 92, 246, 0.1); color: var(--purple-500); }
.plan-business, .plan-business_plus { background: rgba(249, 115, 22, 0.1); color: var(--orange-500); }

/* Navigation Menu */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.nav-item {
    margin-bottom: 4px;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--blue-500), var(--purple-500));
    color: white;
    font-weight: 500;
    height: 44px;
    min-height: 44px;
    padding: 12px 14px;
}

.nav-link i {
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: 15px;
}

.nav-link span {
    white-space: nowrap;
}

/* Usage Bar */
.usage-section {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    margin-bottom: 16px;
}

.usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.usage-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-500), var(--purple-500));
    border-radius: 3px;
    transition: width 0.3s;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    width: 100%;
    background: none;
    border: none;
    color: var(--red-500);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #fef2f2;
}

.logout-btn i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    background: var(--gray-50);
}

/* ============================================
   Page Headings - Icon Styling
   ============================================ */

/* h1 icons - page title badge */
.main-content h1 > i.fas,
.main-content h1 > i.far {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 16px;
    margin-right: 12px;
    vertical-align: middle;
    background: linear-gradient(135deg, var(--blue-500), var(--purple-500));
    color: white;
}

/* h2 icons - section title badge */
.main-content h2 > i.fas,
.main-content h2 > i.far {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 14px;
    margin-right: 10px;
    vertical-align: middle;
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-500);
}

/* h3 icons */
.main-content h3 > i.fas,
.main-content h3 > i.far {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 12px;
    margin-right: 8px;
    vertical-align: middle;
    background: rgba(59, 130, 246, 0.08);
    color: var(--blue-500);
}

/* card-title icons */
.card-title > i.fas,
.card-title > i.far {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 13px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-500);
}

/* Override inline color styles on heading icons */
.main-content h1 > i.fas[style],
.main-content h2 > i.fas[style],
.main-content h3 > i.fas[style],
.card-title > i.fas[style] {
    color: white !important;
    margin-right: 12px !important;
}
.main-content h2 > i.fas[style],
.main-content h3 > i.fas[style],
.card-title > i.fas[style] {
    color: var(--blue-500) !important;
}

/* Color variants for section icons */
.main-content h2 > i.fa-crown { background: rgba(234, 179, 8, 0.1); color: var(--yellow-500); }
.main-content h2 > i.fa-lock,
.main-content h2 > i.fa-shield-alt { background: rgba(139, 92, 246, 0.1); color: var(--purple-500); }
.main-content h2 > i.fa-chart-bar,
.main-content h2 > i.fa-chart-line { background: rgba(34, 197, 94, 0.1); color: var(--green-500); }
.main-content h2 > i.fa-exclamation-triangle { background: rgba(239, 68, 68, 0.1); color: var(--red-500); }
.main-content h2 > i.fa-download { background: rgba(59, 130, 246, 0.1); color: var(--blue-500); }
.main-content h2 > i.fa-check-circle { background: rgba(34, 197, 94, 0.1); color: var(--green-500); }

/* card-title color variants */
.card-title > i.fa-trophy { background: rgba(249, 115, 22, 0.1); color: var(--orange-500) !important; }
.card-title > i.fa-search,
.card-title > i.fa-robot,
.card-title > i.fa-percent,
.card-title > i.fa-bullseye { background: rgba(139, 92, 246, 0.1); color: var(--purple-500) !important; }
.card-title > i.fa-robot { background: rgba(34, 197, 94, 0.1); color: var(--green-500) !important; }
.card-title > i.fa-dice { background: rgba(249, 115, 22, 0.1); color: var(--orange-500) !important; }
.card-title > i.fa-key { background: rgba(234, 179, 8, 0.1); color: var(--yellow-500) !important; }
.card-title > i.fa-user-secret { background: rgba(139, 92, 246, 0.1); color: var(--purple-500) !important; }
.card-title > i.fa-clipboard-check { background: rgba(34, 197, 94, 0.1); color: var(--green-500) !important; }

/* ============================================
   Mobile Header Bar
   ============================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    z-index: 55;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.mobile-header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
}

.mobile-header-logo svg {
    height: 28px;
    width: auto;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:active {
    background: var(--gray-200);
    transform: scale(0.92);
}

.mobile-menu-btn.active {
    background: linear-gradient(135deg, var(--blue-500), var(--purple-500));
    color: white;
}

/* Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0);
    z-index: 45;
    pointer-events: none;
    transition: background 0.3s ease;
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
}

.mobile-overlay.active {
    background: rgba(0,0,0,0.4);
    pointer-events: auto;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* ============================================
   Mobile Bottom Nav (quick access)
   ============================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: white;
    border-top: 1px solid var(--gray-200);
    z-index: 55;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -1px 3px rgba(0,0,0,0.06);
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 10px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav a i {
    font-size: 20px;
    transition: transform 0.2s;
}

.mobile-bottom-nav a.active {
    color: var(--blue-500);
}

.mobile-bottom-nav a.active i {
    transform: scale(1.1);
}

.mobile-bottom-nav a:active {
    transform: scale(0.9);
}

/* ============================================
   Responsive - Tablet & Mobile (< 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .mobile-header {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 50;
        box-shadow: none;
        padding: 1.5rem;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 72px;
        padding-bottom: 80px;
    }
}
