:root {
    --primary: #ff0000;
    --primary-hover: #cc0000;
    --black: #050505;
    --black-light: #151515;
    --text-main: #f5f5f5;
    --text-muted: #a0a0a0;
    --surface: rgba(25, 25, 25, 0.4);
    --surface-hover: rgba(45, 45, 45, 0.6);
    --border: rgba(255, 255, 255, 0.1);
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="light"] {
    --primary: #e60000;
    --primary-hover: #b30000;
    --black: #ffffff;
    --black-light: #f9f9f9;
    --text-main: #111111;
    --text-muted: #666666;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-hover: rgba(240, 240, 240, 1);
    --border: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] header.scrolled .logo,
[data-theme="light"] header.scrolled nav a,
[data-theme="light"] header.scrolled .dropbtn,
[data-theme="light"] header.scrolled .mobile-menu-btn,
[data-theme="light"] header.scrolled #theme-toggle {
    color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--black);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
}

/* Background Animation */
#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    /* ensure light mode keeps a subtle particle effect */
    background: radial-gradient(circle at center, hsla(0, 100%, 50%, 0.1) 0%, var(--black) 100%);
    transition: background var(--transition);
}

.particle {
    position: absolute;
    color: var(--primary);
    opacity: 0.15;
    animation: float infinite linear;
    transition: color var(--transition);
}

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* Typography & Utilities */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    transition: color var(--transition);
}

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

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

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

.text-center { text-align: center; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    transform: scale(1);
}

.btn:hover {
    transform: scale(1.05);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
}

/* Glassmorphism Classes */
.glass {
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

header.scrolled {
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    padding: 10px 5%;
}

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

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

nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

nav a {
    font-weight: 500;
    font-size: 0.95rem;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.dropdown:hover .dropbtn {
    color: var(--primary);
}

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--black-light);
    border: 1px solid var(--border);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #fff;
    padding-left: 20px;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 20px 60px;
    position: relative;
}

.hero h1 {
    font-size: 3.5rem;
    max-width: 800px;
    background: linear-gradient(to right, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 20px auto 40px;
    animation: fadeInUp 1s ease;
}

/* Tools Grid Section */
.tools-section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
}

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

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

.tool-card {
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: var(--primary);
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-10px);
    background: var(--surface-hover);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tool-card:hover::before {
    left: 0;
}

.tool-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
    transition: var(--transition);
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
}

.tool-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

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

.tool-card .btn {
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 20px;
}

/* Inner Page Templates */
.page-header {
    padding: 150px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255,0,0,0.05) 0%, rgba(0,0,0,0) 100%);
}

.page-header h1 {
    font-size: 2.8rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 15px auto 0;
}

.content-section {
    padding: 60px 0;
}

.tool-workspace {
    max-width: 900px;
    margin: -40px auto 60px;
    padding: 40px;
    text-align: center;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 60px 20px;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(255,255,255,0.02);
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(255,0,0,0.05);
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 10px;
}

.workspace-actions {
    margin-top: 30px;
    display: none; /* Shown via JS when files dropped */
}

/* Footer structure */
footer {
    background: var(--black-light);
    padding: 80px 5% 30px;
    margin-top: 60px;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.footer-grid p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(128,128,128,0.15);
    color: var(--text-main);
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* SEO Content Area */
.seo-content {
    max-width: 900px;
    margin: 80px auto;
}

.seo-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    margin-top: 40px;
}

.seo-content h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    margin-top: 30px;
}

.seo-content p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.seo-content ul {
    color: var(--text-muted);
    margin-left: 20px;
    margin-bottom: 20px;
}

.seo-content li {
    margin-bottom: 10px;
}

/* Tool output / UI states */
.loading-indicator {
    display: none;
    margin-top: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto 15px;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Generic Layout */
.file-list {
    text-align: left;
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-item .remove-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
}

/* Responsive */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    
    .mobile-menu-btn {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background: rgba(10,10,10,0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding-top: 80px;
        transition: 0.4s ease;
        border-left: 1px solid var(--border);
    }
    
    nav.active {
        right: 0;
    }
    
    nav a, .dropbtn {
        font-size: 1.1rem;
        padding: 15px 20px;
        width: 100%;
        text-align: left;
    }
    
    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        display: none;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }
    
    .footer-links {
        align-items: center;
    }
}
