
/* --- VARIABLE DEFINITIONS --- */
:root {
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;

    /* Light Mode Colors */
    --bg-color: #f0f2f5;
    --bg-color-rgb: 240, 242, 245;
    --card-bg-color: rgba(255, 255, 255, 0.6);
    --text-color: #1a1a1a;
    --heading-color: #0d0d0d;
    --border-color: rgba(0, 0, 0, 0.1);
    --header-bg: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --neon-glow-color: rgba(79, 70, 229, 0.7);
    --primary-color: #4F46E5;
    --primary-color-rgb: 79, 70, 229;
    --secondary-color: #6B7280;
    --link-hover-color: #3b82f6;
    --sun-color: #facc15;
    --moon-color: #6b7280;
}

body.dark-mode {
    /* Dark Mode Colors */
    --bg-color: #111827;
    --bg-color-rgb: 17, 24, 39;
    --card-bg-color: rgba(31, 41, 55, 0.5);
    --text-color: #d1d5db;
    --heading-color: #f9fafb;
    --border-color: rgba(255, 255, 255, 0.15);
    --header-bg: rgba(17, 24, 39, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --neon-glow-color: rgba(59, 130, 246, 0.6);
    --primary-color: #3B82F6;
    --primary-color-rgb: 59, 130, 246;
    --secondary-color: #9CA3AF;
    --link-hover-color: #60a5fa;
    --sun-color: #fde047;
    --moon-color: #e5e7eb;
}

/* --- GENERAL STYLES --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-image: 
        radial-gradient(at 20% 20%, hsla(217, 70%, 50%, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 10%, hsla(262, 60%, 55%, 0.1) 0px, transparent 50%),
        radial-gradient(at 20% 90%, hsla(340, 70%, 55%, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 80%, hsla(190, 70%, 50%, 0.1) 0px, transparent 50%);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

main {
    padding-top: 80px; /* Space for sticky header */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover-color);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

ul {
    list-style: none;
}

/* --- GLASSMORPHISM CARD --- */
.glassmorphism-card {
    background-color: var(--card-bg-color);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    transition: all 0.3s ease-in-out;
}

/* --- HEADER & NAVIGATION --- */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.sticky-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-color);
}

.desktop-nav {
    display: none; /* Hidden on mobile by default */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--card-bg-color);
    backdrop-filter: blur(10px);
    min-width: 280px;
    box-shadow: 0 8px 16px 0 var(--shadow-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    z-index: 1;
    padding: 0.5rem 0;
    max-height: 70vh;
    overflow-y: auto;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-content a:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
}

.dropdown-content a svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* Theme Switcher */
.theme-switcher {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-switcher svg {
    transition: all 0.3s ease;
}
.theme-switcher .sun {
    display: none;
    color: var(--sun-color);
}
.theme-switcher .moon {
    display: block;
    color: var(--moon-color);
}
body.dark-mode .theme-switcher .sun {
    display: block;
}
body.dark-mode .theme-switcher .moon {
    display: none;
}

/* Hamburger Menu */
.hamburger-menu {
    width: 24px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.hamburger-menu span {
    width: 100%;
    height: 2px;
    background-color: var(--heading-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Navigation */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--bg-color-rgb), 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-nav-overlay.open {
    transform: translateY(0);
}

.mobile-nav-content {
    text-align: center;
}

.mobile-nav-link, .mobile-dropbtn {
    font-size: 2rem;
    color: var(--heading-color);
    padding: 1rem;
    display: block;
    font-weight: 600;
}

.close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3rem;
    color: var(--heading-color);
}

.mobile-dropdown-content {
    display: none;
    background: rgba(var(--primary-color-rgb), 0.05);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 40vh;
    overflow-y: auto;
}

.mobile-dropdown-content a {
    font-size: 1.2rem;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-color);
}
.mobile-dropdown-content a svg {
    width: 18px;
    height: 18px;
}

/* --- BUTTONS --- */
.cta-button, .cta-button-secondary {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    border: 2px solid transparent;
    text-align: center;
}

/* Neon Button */
.cta-button {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 10px var(--neon-glow-color), 0 0 20px var(--neon-glow-color);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--neon-glow-color), 0 0 30px var(--neon-glow-color);
    color: white;
}

/* Ghost Button */
.cta-button-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.cta-button-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* --- HOMEPAGE STYLES --- */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--link-hover-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.hero .subtitle {
    font-size: 1.1rem;
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.section-description {
    text-align: center;
    font-size: 1rem;
    color: var(--secondary-color);
    max-width: 700px;
    margin: 0 auto 3rem;
}

#tools-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

.tool-card-link {
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
}

.tool-card {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    width: 100%;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 var(--shadow-color);
}

.tool-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}
.tool-card .icon svg {
    width: 48px;
    height: 48px;
    margin: 0 auto;
}

.tool-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--secondary-color);
    flex-grow: 1;
}

.how-it-works-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

.step-card {
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* --- TOOL PAGE STYLES --- */
.tool-header {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.tool-header h1 {
    font-size: 2.2rem;
}

.tool-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tool-main-section {
    padding: 1.5rem;
}

.tool-io-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.io-box {
    display: flex;
    flex-direction: column;
}

.io-box label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--heading-color);
}

.io-box textarea, .io-box input[type="text"], .io-box input[type="number"], .io-box select, .io-box input[type="range"] {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(var(--bg-color-rgb), 0.7);
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 150px;
    transition: all 0.3s ease;
}

.io-box input[type="text"], .io-box input[type="number"], .io-box select, .io-box input[type="range"] {
    min-height: auto;
}

.io-box textarea:focus, .io-box input:focus, .io-box select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2);
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.result-area {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(var(--bg-color-rgb), 0.5);
    border: 1px dashed var(--border-color);
    word-wrap: break-word;
}

#image-preview, #pdf-preview, #audio-preview, #svg-preview {
    max-width: 100%;
    border: 1px dashed var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bg-color-rgb), 0.5);
}

#pdf-preview iframe {
    width: 100%;
    height: 500px;
    border: none;
}

/* --- CONTENT PAGES (About, FAQ, etc.) --- */
.content-page {
    padding: 3rem 0;
}

.content-page .container {
    max-width: 800px;
}

.content-page h1 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.content-page h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.content-page ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.content-page li {
    margin-bottom: 0.5rem;
}

/* --- FOOTER --- */
.site-footer {
    background: var(--card-bg-color);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 4rem;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-column ul {
    padding: 0;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: var(--secondary-color);
}
.footer-column a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-icons a {
    font-size: 1.2rem;
}

/* --- RESPONSIVENESS (MOBILE-FIRST) --- */

/* Base styles for max-width: 480px are the default styles */

/* Specific font size adjustments for small mobile */
@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .hero .subtitle { font-size: 0.9rem; }
    .section-title { font-size: 1.8rem; }
    .section-description { font-size: 0.9rem; }
    .tool-header h1 { font-size: 1.8rem; }
    .tool-card h3 { font-size: 1.1rem; }
    .tool-card p { font-size: 0.9rem; }
    .mobile-nav-link, .mobile-dropdown .mobile-dropbtn { font-size: 1.5rem; }
    .mobile-dropdown-content a { font-size: 1.1rem; }
    .cta-button, .cta-button-secondary { padding: 0.7rem 1.2rem; font-size: 0.9rem; }
    .content-page h1 { font-size: 1.8rem; }
    .content-page h3 { font-size: 1.2rem; }
    .content-page p, .content-page ul { font-size: 0.9rem; }
}

/* Mobile landscape and small tablets */
@media (min-width: 481px) {
    #tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }
    .social-icons {
        justify-content: flex-start;
    }
}

/* Tablets */
@media (min-width: 768px) {
    .hamburger-menu {
        display: none;
    }
    .desktop-nav {
        display: block;
    }
    .hero h1 {
        font-size: 3rem;
    }
    .hero .subtitle {
        font-size: 1.2rem;
    }
    #tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .how-it-works-steps {
        flex-direction: row;
        justify-content: space-around;
    }
    .step-card {
        max-width: 30%;
    }
    .tool-io-grid {
        grid-template-columns: 1fr 1fr;
    }
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktops */
@media (min-width: 992px) {
    #tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .tool-container {
        flex-direction: row;
    }
    .tool-main-section {
        flex: 3;
    }
    .tool-sidebar {
        flex: 1;
    }
}
