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

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #06B6D4;
    --bg-color: #F8FAFC;
    --surface: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.7);
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: rgba(15, 23, 42, 0.1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --gradient-1: linear-gradient(135deg, #4F46E5 0%, #06B6D4 100%);
    --gradient-bg: linear-gradient(135deg, #f0fdfa 0%, #e0e7ff 100%);
}

[data-theme="dark"] {
    --bg-color: #0B1120;
    --surface: #1E293B;
    --surface-glass: rgba(30, 41, 59, 0.7);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: rgba(255, 255, 255, 0.1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    --gradient-bg: linear-gradient(135deg, #0f172a 0%, #020617 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--gradient-bg);
    background-color: var(--bg-color);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--text-main);
    transition: color 0.2s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 2rem; }
.hidden { display: none !important; }

/* ================== GLASSMORPHISM ================== */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s, border-color 0.3s;
}

.glass-panel {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 2rem;
}

.glass-card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 70, 229, 0.4);
}

.glass-hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

/* ================== TYPOGRAPHY & GRADIENTS ================== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ================== HEADER ================== */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary);
}

.logo-icon {
    background: var(--gradient-1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.desktop-nav a {
    font-weight: 500;
    position: relative;
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.desktop-nav a:hover::after,
.desktop-nav a.active::after {
    width: 100%;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-main);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.btn-icon:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.mobile-only { display: none; }

.mobile-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    z-index: 999;
    box-shadow: var(--shadow-md);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 20px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav a {
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

/* ================== HERO & SEARCH ================== */
.hero-section {
    position: relative;
    padding: 5rem 0;
    margin: 2rem auto;
    max-width: 1160px;
    overflow: hidden;
    border-radius: 30px;
    border: 1px solid var(--border);
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero-section h1 { font-size: 3.5rem; }
.hero-sub { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 2.5rem; }

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

#global-search {
    width: 100%;
    padding: 1.25rem 1.5rem 1.25rem 3.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    outline: none;
}

#global-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

/* Background Blobs (3D Depth Effect) */
.hero-bg-elements {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(60px);
    opacity: 0.4;
    border-radius: 50%;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    width: 300px; height: 300px;
    background: var(--primary);
    top: -100px; left: -50px;
}

.blob-2 {
    width: 250px; height: 250px;
    background: var(--secondary);
    bottom: -100px; right: -50px;
    animation-delay: -5s;
}

/* ================== TOOLS GRID ================== */
.category-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tool-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient-1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-grow: 1;
}

.tool-hover-arrow {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    opacity: 0;
    transform: translateX(-10px);
    color: var(--primary);
    transition: all 0.3s ease;
}

.tool-card:hover .tool-hover-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ================== INDIVIDUAL TOOL PAGE ================== */
.tool-page { margin-top: 2rem; margin-bottom: 4rem; }
.breadcrumbs { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.breadcrumbs a { color: var(--primary); font-weight: 500; }
.breadcrumbs a:hover { text-decoration: underline; }

.tool-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tool-icon-large {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--gradient-1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

/* Form Styles for Tools */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

/* ================== FOOTER ================== */
.main-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 4rem 0 0;
    margin-top: auto;
}

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

.footer-brand p {
    color: var(--text-muted);
    margin: 1rem 0;
}

.socials {
    display: flex;
    gap: 1rem;
}

.socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.socials a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px);
}

.footer-links h4 { font-size: 1.1rem; margin-bottom: 1.2rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }

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

/* ================== ANIMATIONS & MEDIA QUERIES ================== */
@keyframes float {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-30px) scale(1.1); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 992px) {
    .tool-layout { grid-template-columns: 1fr; }
    .hero-section h1 { font-size: 2.5rem; }
}

@media (max-width: 1100px) {
    .desktop-nav a, .desktop-nav .has-dropdown { display: none; }
    .desktop-nav { gap: 0; }
    .mobile-only { display: block; }
    .footer-content { grid-template-columns: 1fr; gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ================== MEGA-MENU DROPDOWN ================== */
.has-dropdown {
    position: relative;
    cursor: pointer;
}
.has-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    padding: 1rem 0;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    list-style: none;
    z-index: 100;
}
.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu li a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}
.dropdown-menu li a:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}
.mobile-cat-header {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 1rem;
    padding: 0 1rem;
}
.mobile-tool-link {
    display: block;
    padding: 0.5rem 1.5rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
}