/* CSS Reset and Variables */
:root {
    --primary: #0066FF;
    --primary-hover: #0052CC;
    --secondary: #E0E7FF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --bg-main: #FFFFFF;
    --bg-alt: #F8FAFC;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.5;
}

/* Typography */
h1, h2, h3 { font-weight: 700; color: var(--text-main); }
a { text-decoration: none; color: inherit; transition: all 0.2s; }

/* Navigation */
nav {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a:hover {
    color: var(--primary);
}

.tools-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.tools-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    min-width: 250px;
    margin-top: 15px; /* So it gives some space below navbar */
}

/* Invisible bridge so hover state doesn't break when moving mouse out of link */
.tools-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 15px;
}

.tools-menu:hover .tools-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tools-search {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.tools-search:focus {
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero {
    padding: 80px 5% 40px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-alt) 0%, white 100%);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Dropzone */
.dropzone {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border: 2px dashed var(--primary);
    border-radius: 20px;
    padding: 4rem 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.dropzone:hover {
    background: var(--bg-alt);
    border-color: var(--primary-hover);
    transform: scale(1.01);
}

.dropzone-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Converter Grid */
.converters {
    padding: 80px 5%;
}

.section-title {
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 12px 30px rgba(0, 102, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-8px);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.card h3 {
    margin-bottom: 8px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Footer */
footer {
    background: var(--text-main);
    color: white;
    padding: 60px 5%;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #94A3B8;
}

.footer-col a:hover {
    color: white;
}

/* Tools Menu Styles */
.tools-menu { position: relative; }
.tools-dropdown { 
    display: none; 
    position: absolute; 
    background: white; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    margin-top: 5px; 
    padding: 12px; 
    width: 280px; 
    left: 50%; 
    transform: translateX(-50%); 
    z-index: 1000; 
}
.tools-menu:hover .tools-dropdown { display: block; }
.tools-search { 
    width: 100%; 
    padding: 10px 14px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    outline: none; 
    margin-bottom: 12px; 
    font-size: 0.9rem;
    box-sizing: border-box;
}
.tools-search:focus { border-color: var(--primary); }
.tools-list a { 
    display: flex; 
    align-items: center; 
    gap: 12px;
    padding: 10px 12px; 
    color: var(--text-main); 
    text-decoration: none; 
    border-radius: 8px; 
    transition: 0.2s; 
    font-size: 0.95rem;
    font-weight: 500;
}
.tools-list a i { color: var(--primary); width: 20px; text-align: center; }
.tools-list a:hover { background: var(--bg-alt); color: var(--primary); }
.tools-list a.hidden { display: none; }

/* Custom Searchable Select Dropdowns */
.custom-dropdown { position: relative; width: 220px; z-index: 100; text-align: left; }
.custom-dropdown .dropdown-trigger { height: 48px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--border); font-size: 1rem; background: white; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: all 0.2s; color: var(--text-main); width: 100%; box-sizing: border-box; }
.custom-dropdown .dropdown-trigger:hover { border-color: #cbd5e1; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.custom-dropdown.open .dropdown-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.custom-dropdown.open .chevron { transform: rotate(180deg); }
.custom-dropdown .dropdown-menu { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: white; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 8px; display: none; max-height: 320px; flex-direction: column; overflow: hidden; z-index: 9999; }
.custom-dropdown.open .dropdown-menu { display: flex; }
.custom-dropdown .dropdown-search { padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; margin-bottom: 8px; outline: none; width: 100%; box-sizing: border-box; }
.custom-dropdown .dropdown-search:focus { border-color: var(--primary); }
.custom-dropdown .dropdown-items { overflow-y: auto; flex: 1; }
.custom-dropdown .dropdown-item { padding: 10px 14px; font-size: 0.95rem; font-weight: 500; color: var(--text-main); border-radius: 6px; cursor: pointer; }
.custom-dropdown .dropdown-item:hover { background: var(--bg-alt); }
.custom-dropdown .dropdown-item.selected { color: var(--primary); background: rgba(59, 130, 246, 0.1); font-weight: 600; }
.custom-dropdown .dropdown-item.hidden { display: none; }
.custom-dropdown .dropdown-group-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin: 12px 10px 4px; letter-spacing: 0.5px; }
.custom-dropdown .no-results { padding: 16px; text-align: center; font-size: 0.9rem; color: var(--text-muted); display: none; }

.format-connector { 
    background: var(--bg-alt); 
    width: 48px; 
    height: 48px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border: 1px solid var(--border); 
    color: var(--primary);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.format-selectors {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

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

/* Side Ads Layout */
.side-ad {
    position: absolute;
    top: 150px;
    z-index: 5;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.side-ad-left { left: 20px; }
.side-ad-right { right: 20px; }

@media (max-width: 1500px) {
    .side-ad { display: none; }
}
