/* ==========================================================================
   CSS Variables & Tokens (YouTube-like Light Theme)
   ========================================================================== */
   :root {
    /* Colors - Light Theme */
    --bg-main: #F9F9F9;
    --bg-panel: #FFFFFF;
    --bg-panel-hover: #F2F2F2;
    --border-color: #E5E5E5;
    
    --text-main: #0F0F0F;
    --text-muted: #606060;
    
    --primary: #CC0000; /* YouTube Red */
    --primary-hover: #990000;
    
    --success: #065FD4; /* YouTube blue for success/links */
    --warning: #F59E0B;
    --danger: #CC0000;

    /* Gradients (Not used much in this theme, kept for compatibility) */
    --grad-primary: #CC0000;
    --grad-hover: #990000;
    
    /* Typography */
    --font-sans: 'Roboto', 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 4px 12px 0 rgba(0, 0, 0, 0.05); /* Softer shadow for cards */
    
    --transition: all 0.2s ease-in-out;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   Card Utilities (Replaces glass-panel for this theme)
   ========================================================================== */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}

.glass-panel:hover {
    background: var(--bg-panel);
    border-color: #CCCCCC;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-main);
}

h2 { font-size: 1.5rem; margin-bottom: 1.5rem; font-weight: 600; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; font-weight: 500; }

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full); /* Pill shaped like YT */
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.1);
}

input[type="text"], input[type="number"], input[type="password"], select, textarea {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--success);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

.search-bar-sm {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 2rem;
    display: flex;
}

@media (min-width: 768px) {
    .search-bar-sm { display: flex; }
}

.search-bar-sm input {
    flex: 1;
    border: 1px solid #CCCCCC;
    border-right: none;
    border-radius: var(--radius-full) 0 0 var(--radius-full);
    padding-left: 1.2rem;
    height: 40px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.search-bar-sm .search-btn {
    width: 64px;
    height: 40px;
    background: #F8F8F8;
    border: 1px solid #CCCCCC;
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: background 0.2s;
}

.search-bar-sm .search-btn:hover {
    background: #F0F0F0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a:not(.btn) {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.nav-links a:not(.btn):hover {
    color: var(--text-main);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
    flex: 1;
    padding: 2rem 0 4rem;
}

.grid {
    display: grid;
    gap: 1.2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.view-all {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--success); /* Blue link */
    font-weight: 500;
    font-size: 0.9rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    padding: 3rem 0 3rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.main-search {
    position: relative;
    max-width: 650px;
    margin: 0 auto 1.5rem;
    display: flex;
}

.main-search input {
    flex: 1;
    border: 1px solid #CCCCCC;
    border-radius: var(--radius-full) 0 0 var(--radius-full);
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.main-search .btn {
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    padding: 0.75rem 2rem;
    background: #F8F8F8;
    color: var(--text-main);
    border: 1px solid #CCCCCC;
    border-left: none;
}

.main-search .btn:hover {
    background: #F0F0F0;
}

.trending-tags {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.trending-tags .tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #F2F2F2;
    border-radius: var(--radius-full);
    margin: 0 0.25rem;
    color: var(--text-main);
    font-weight: 500;
}

.trending-tags .tag:hover {
    background: #E5E5E5;
}

/* ==========================================================================
   Categories Grid
   ========================================================================== */
.categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    margin-bottom: 3rem;
}

.category-card {
    padding: 1.5rem;
    text-align: center;
    border: none;
    box-shadow: none;
    background: transparent;
}

.category-card:hover {
    background: #F2F2F2;
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.icon-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
    background: #F2F2F2;
    color: var(--text-main);
}

.category-card:hover .icon-box {
    background: #FFFFFF;
}

.dev-icon { color: #065FD4; }
.img-icon { color: #CC0000; }
.text-icon { color: #0F9D58; }
.sec-icon { color: #F4B400; }

.category-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Tools Grid
   ========================================================================== */
.tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    margin-bottom: 4rem;
}

.tool-card {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.tool-header .icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    margin: 0;
}

.fav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--transition);
}

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

.tool-card h3 {
    margin-bottom: 0.25rem;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    flex: 1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 0;
    margin-top: auto;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin: 1rem 0;
    max-width: 300px;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 0.5rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F2F2F2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-main);
}

.social-links a:hover {
    background: #E5E5E5;
}

.footer-links h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-links ul li {
    margin-bottom: 0.5rem;
}

.footer-links ul a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links ul a:hover {
    color: var(--text-main);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   Tool Pages Overrides for Light Theme
   ========================================================================== */
#password-result, #json-input, #json-output {
    background: #FFFFFF !important;
    border: 1px solid #CCCCCC !important;
    color: var(--text-main) !important;
}

#password-result:focus, #json-input:focus {
    border-color: var(--success) !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .footer-container { grid-template-columns: 1fr; }
}
