/* Toolera - Main Stylesheet */

/* ============================================
   CSS Variables & Theme Configuration
   ============================================ */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f3f4f6;
    --header-bg: rgba(255, 255, 255, 0.95);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #020617;
    --bg-tertiary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --card-bg: #1e293b;
    --sidebar-bg: #1a1f2e;
    --sidebar-hover: #252b3b;
    --header-bg: rgba(26, 31, 46, 0.95);
}

/* ============================================
   Base Styles
   ============================================ */

* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ============================================
   Utility Classes
   ============================================ */

/* Gradients */
.gradient-bg {
    background: var(--gradient-primary);
}

.gradient-bg-alt {
    background: var(--gradient-secondary);
}

/* Text Colors */
.text-themed {
    color: var(--text-primary);
}

.text-secondary-themed {
    color: var(--text-secondary);
}

.border-themed {
    border-color: var(--border-color);
}

/* ============================================
   Card Components
   ============================================ */

.card-themed {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   Sidebar Navigation
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 40;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-hidden {
    transform: translateX(-100%);
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* Category Headers */
.category-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin: 8px 4px 2px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.category-header i {
    width: 14px;
    margin-right: 8px;
    text-align: center;
    font-size: 11px;
}

/* Tool Links */
.tool-link {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    margin: 1px 4px;
    font-size: 13px;
    font-weight: 500;
}

.tool-link:hover {
    background: var(--sidebar-hover);
    transform: translateX(3px);
}

.tool-link.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.tool-link.active i {
    color: white;
}

.tool-link i {
    width: 16px;
    margin-right: 8px;
    text-align: center;
    font-size: 13px;
    color: #667eea;
}

/* ============================================
   Main Content Area
   ============================================ */

.main-content {
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Search Component
   ============================================ */

.search-box {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.search-results a {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    transition: background-color 0.2s ease;
    color: var(--text-primary);
    text-decoration: none;
}

.search-results a:hover {
    background: var(--sidebar-hover);
}

.search-results a i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    color: #667eea;
}

/* ============================================
   Floating Action Button
   ============================================ */

.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.fab:active {
    transform: translateY(-2px) scale(1.02);
}

/* ============================================
   Badge Styles
   ============================================ */

.badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(240, 147, 251, 0.3);
}

.badge-popular {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(79, 172, 254, 0.3);
}

.badge-featured {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(250, 112, 154, 0.3);
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   Responsive Design - Tablet
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 260px !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar .p-4 {
        padding: 0.75rem;
    }

    .sidebar .mb-6 {
        margin-bottom: 0.75rem;
    }

    .sidebar .mb-5 {
        margin-bottom: 0.75rem;
    }

    .sidebar .space-y-1 {
        gap: 0.125rem;
    }

    .sidebar .my-4 {
        margin-top: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .tool-link {
        padding: 8px 10px;
        font-size: 12.5px;
        margin: 0.5px 3px;
    }

    .tool-link i {
        width: 15px;
        margin-right: 7px;
        font-size: 12px;
    }
}

/* ============================================
   Responsive Design - Mobile
   ============================================ */

@media (max-width: 640px) {
    .sidebar {
        width: 240px !important;
    }

    .category-header {
        padding: 6px 8px;
        margin: 6px 3px 1px 3px;
        font-size: 10px;
    }

    .category-header i {
        width: 12px;
        margin-right: 6px;
        font-size: 10px;
    }

    .tool-link {
        padding: 7px 8px;
        font-size: 12px;
    }

    .tool-link i {
        width: 14px;
        margin-right: 6px;
        font-size: 11px;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .sidebar,
    .fab,
    .search-box {
        display: none;
    }

    .main-content {
        margin-left: 0 !important;
    }
}
