/**
 * assets/css/style.css
 * Premium Light-Theme Design System for Resell Rights Platform.
 * Supports fully responsive desktop/mobile layouts, breadcrumbs, unified inputs, and animations.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.08);
    --secondary: #64748b;
    --dark: #0f172a;
    --light: #f8fafc;
    --border: #e2e8f0;
    --white: #ffffff;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --violet: #8b5cf6;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--light) !important;
    color: var(--dark) !important;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 0.95rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--dark) !important;
}

a {
    color: var(--primary);
    transition: all 0.2s ease;
}
a:hover {
    color: var(--primary-hover);
}

/* Gradients */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-emerald {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Global Layout Structure */
.wrapper-layout {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: calc(100vh - 73px); /* Subtract header navbar height */
}

#content {
    width: 100%;
    padding: 35px;
    min-height: 100vh;
    transition: all 0.3s ease;
    background-color: var(--light);
}

/* Sidebar Styling */
#sidebar {
    min-width: 280px;
    max-width: 280px;
    background: var(--white);
    border-right: 1px solid var(--border);
    transition: all 0.3s ease;
    position: sticky;
    top: 73px;
    height: calc(100vh - 73px);
    overflow-y: auto;
    z-index: 1000;
}

#sidebar .sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul p {
    color: var(--secondary);
    padding: 10px 24px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#sidebar ul li a {
    padding: 12px 24px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
    font-weight: 500;
    border-left: 4px solid transparent;
}

#sidebar ul li a:hover, #sidebar ul li.active > a {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
}

#sidebar ul li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Collapsible Dropdowns */
.sidebar-submenu a {
    padding: 8px 24px 8px 48px !important;
    font-size: 0.88rem !important;
    border-left: none !important;
    font-weight: 400 !important;
}

.sidebar-submenu li.active a {
    color: var(--primary) !important;
    background: var(--primary-light) !important;
    font-weight: 600 !important;
}

#sidebar .dropdown-toggle::after {
    display: inline-block;
    margin-left: auto;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transition: transform 0.3s;
}

#sidebar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Mobile responsive navigation overrides */
.close-sidebar-btn {
    display: none;
}

@media (max-width: 991px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        width: 280px;
        z-index: 1060;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
        margin-left: 0 !important;
        top: 0 !important;
        height: 100% !important;
    }
    #sidebar.active {
        left: 0;
    }
    #sidebarCollapse span {
        display: none;
    }
    .close-sidebar-btn {
        display: block !important;
    }
    #content {
        padding: 20px 15px !important;
    }
}

/* Premium Cards & Glassmorphism Details */
.saas-card, .premium-card, .glass-card {
    background: var(--white) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.saas-card:hover, .premium-card:hover, .glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.06) !important;
    border-color: rgba(37, 99, 235, 0.2) !important;
}

/* Cards dark overrides check */
.dark-dashboard {
    background-color: var(--light);
}

/* Breadcrumb Navigation */
.breadcrumb-saas {
    display: flex;
    flex-wrap: wrap;
    padding: 0 0 15px;
    margin-bottom: 20px;
    list-style: none;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.breadcrumb-saas li {
    display: flex;
    align-items: center;
    color: var(--secondary);
}

.breadcrumb-saas li+li::before {
    content: "\f105";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    padding: 0 8px;
    color: #cbd5e1;
}

.breadcrumb-saas a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-saas a:hover {
    text-decoration: underline;
}

/* Unified Form Controls */
.form-control, .form-select {
    background-color: var(--white) !important;
    border: 1px solid var(--border) !important;
    color: var(--dark) !important;
    border-radius: 10px !important;
    padding: 10px 16px !important;
    font-size: 0.95rem !important;
    transition: all 0.2s ease !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
    outline: none !important;
}

.form-control::placeholder {
    color: #94a3b8 !important;
}

.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
    font-size: 0.88rem;
}

/* Premium Buttons & Links */
.saas-btn, .btn-premium {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 12px 28px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.saas-btn:hover, .btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3) !important;
    opacity: 0.95;
    color: var(--white) !important;
}

.btn-premium-outline {
    background: transparent !important;
    border: 2px solid var(--primary) !important;
    color: var(--primary) !important;
    border-radius: 10px !important;
    padding: 10px 26px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-premium-outline:hover {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%) !important;
    border-color: transparent !important;
    color: var(--white) !important;
    transform: translateY(-2px);
}

/* Refer & Earn Special Button & Payout Tickers */
.btn-refer {
    background: linear-gradient(135deg, var(--warning) 0%, var(--danger) 100%) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 10px 22px !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn-refer:hover {
    transform: translateY(-2px) scale(1.03) !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5) !important;
}

.btn-refer::after {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    left: -60% !important;
    width: 30% !important;
    height: 200% !important;
    background: rgba(255, 255, 255, 0.3) !important;
    transform: rotate(30deg) !important;
    animation: shine 5s infinite ease-in-out !important;
}

@keyframes shine {
    0% { left: -70%; }
    15% { left: 120%; }
    100% { left: 120%; }
}

.btn-refer i.fa-gift {
    animation: floatGift 2s infinite ease-in-out !important;
    display: inline-block !important;
}

@keyframes floatGift {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-3px) rotate(15deg); }
}

/* Premium Light Theme Tables */
.table-responsive-saas {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    margin-bottom: 24px;
}

.table-saas {
    width: 100%;
    margin-bottom: 0;
    color: var(--dark);
    border-collapse: collapse;
}

.table-saas th {
    background-color: var(--light) !important;
    color: var(--secondary) !important;
    border-bottom: 2px solid var(--border) !important;
    font-weight: 600;
    padding: 16px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-saas td {
    padding: 16px;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle;
    font-size: 0.92rem;
}

.table-saas tr:hover td {
    background-color: rgba(37, 99, 235, 0.02) !important;
}

/* Chat bubble designs */
.chat-bubble {
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 12px;
    max-width: 75%;
    font-size: 0.92rem;
    line-height: 1.5;
}

.chat-bubble.admin-bubble {
    background: var(--primary-light);
    border: 1px solid rgba(37, 99, 235, 0.15);
    margin-left: auto;
    color: var(--primary);
    border-bottom-right-radius: 2px;
}

.chat-bubble.user-bubble {
    background: #f1f5f9;
    border: 1px solid var(--border);
    margin-right: auto;
    color: var(--dark);
    border-bottom-left-radius: 2px;
}

/* Access control badge layouts */
.ref-stat-card {
    border-left: 4px solid var(--primary);
}
.ref-stat-card.qualified { border-left-color: var(--success); }
.ref-stat-card.expired { border-left-color: var(--danger); }
.ref-stat-card.earnings { border-left-color: var(--warning); }

/* Quick Actions Button Cards */
.quick-action-saas-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s ease;
}

.quick-action-saas-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.05);
    border-color: var(--primary);
    color: var(--primary) !important;
}

.quick-action-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Timeline/Roadmap styling */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 9px;
    width: 2px;
    background-color: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 2px solid var(--white);
}

.timeline-item.success::before { background-color: var(--success); }
.timeline-item.warning::before { background-color: var(--warning); }
.timeline-item.danger::before { background-color: var(--danger); }
