/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Premium Dark Theme Colors */
    --bg-main: #0a0a0b;
    --bg-card: rgba(20, 20, 22, 0.7);
    --bg-sidebar: #0f0f11;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    
    /* Typography */
    --font-main: 'Inter', sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 12px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--accent-color);
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding: 0 12px;
    font-weight: 600;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 60px;
    max-width: 1200px;
}

/* Header & Search */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 24px;
}

.hero-text h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.search-container {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#global-search {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#global-search:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Tools Section */
.tools-section h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    font-weight: 600;
}

/* Grid Layout */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Cards (Glassmorphism & Premium feel) */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.05);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent-color);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tool-info h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.tool-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.6;
    flex: 1;
}

.launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    width: fit-content;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.launch-btn i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.tool-card:hover .launch-btn {
    background: var(--accent-color);
}

.tool-card:hover .launch-btn i {
    transform: translateX(4px);
}

/* Badges */
.badge {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.new-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.popular-badge {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 0;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.no-results i {
    font-size: 3rem;
    opacity: 0.5;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-header {
        margin-bottom: 0;
    }

    .menu-toggle {
        display: block;
    }
    
    .categories {
        display: none;
        flex-direction: column;
        margin-top: 20px;
    }
    
    .sidebar.open .categories {
        display: flex;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .sidebar.open .sidebar-footer {
        display: block;
        margin-top: 20px;
    }
    
    .main-content {
        padding: 24px;
    }
    
    .topbar {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 32px;
    }
    
    .search-container {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

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