/* --- DESIGN SYSTEM & RESET --- */
:root {
    --primary-red: #e5322d;
    --primary-red-dark: #c42621;
    --background-light: #f8f8fa;
    --background-white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --error-color: #dc3545;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --container-width: 1200px;
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background-color: var(--background-white);
    line-height: 1.6;
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; color: var(--primary-red); }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; color: var(--text-light); }
a { color: var(--primary-red); text-decoration: none; }
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- HEADER & NAVIGATION --- */
.header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--background-white);
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: box-shadow 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

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

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

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.hamburger { display: none; }
.mobile-nav { display: none; }

/* --- HERO SECTION --- */
#hero {
    padding: 6rem 0;
    text-align: center;
    background: linear-gradient(180deg, var(--background-white) 0%, var(--background-light) 100%);
}

#hero h1 {
    margin-bottom: 1rem;
}

#hero p {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* --- TOOLS GRID --- */
#tools {
    padding: 4rem 0;
    background-color: var(--background-light);
}
#tools h2 { text-align: center; margin-bottom: 3rem; }

#tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.tool-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-red);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-red);
}
.tool-card h3 { color: var(--text-dark); margin-bottom: 0.5rem; }
.tool-card p { font-size: 0.9rem; }

/* --- ARTICLE SECTION --- */
#about-us { padding: 4rem 0; }
#about-us h2 { text-align: center; margin-bottom: 3rem; }
#about-us .container > div { max-width: 800px; margin: 0 auto; }
#about-us h3 { margin-top: 2rem; margin-bottom: 1rem; color: var(--text-dark); }
#about-us ul { list-style-position: inside; margin-left: 1rem; margin-bottom: 1rem; }

/* --- MODAL --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--background-white);
    border-radius: 8px;
    padding: 2rem;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    max-height: calc(90vh - 4rem);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h2 { color: var(--primary-red); }
.close-btn {
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    overflow-y: auto;
    padding-right: 1rem;
    margin-right: -1rem; /* Offset for scrollbar */
}

.drop-area {
    border: 2px dashed var(--primary-red);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--background-light);
    transition: background-color 0.3s ease;
}
.drop-area.dragover { background-color: #ffe8e7; }
.drop-area p { margin: 0; }

#file-list { margin-top: 1rem; }
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.remove-file-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
}

.tool-options { margin-top: 1.5rem; }
.tool-options label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.tool-options input, .tool-options select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.process-btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background-color: var(--primary-red);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: background-color 0.3s ease;
}
.process-btn:hover { background-color: var(--primary-red-dark); }
.process-btn:disabled { background-color: #ccc; cursor: not-allowed; }

#output-area { margin-top: 1.5rem; }
.download-link {
    display: inline-block;
    background-color: var(--success-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

/* --- LOADER --- */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    flex-direction: column;
}
.spinner {
    border: 8px solid var(--background-light);
    border-top: 8px solid var(--primary-red);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}
#loader-text { margin-top: 1rem; font-size: 1.1rem; color: var(--text-dark); }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- FOOTER --- */
.footer {
    background-color: var(--text-dark);
    color: #ccc;
    padding: 3rem 0;
    font-size: 0.9rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer h4 { color: white; margin-bottom: 1rem; }
.footer a { color: #ccc; transition: color 0.3s ease; }
.footer a:hover { color: var(--primary-red); }
.footer ul { list-style: none; }
.footer li { margin-bottom: 0.5rem; }
.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
}

/* --- REVEAL ANIMATION --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    #tools-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    
    .nav-links { display: none; }
    .hamburger {
        display: block;
        cursor: pointer;
        background: none;
        border: none;
        z-index: 1001;
    }
    .hamburger .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        background-color: var(--text-dark);
        transition: all 0.3s ease-in-out;
    }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .mobile-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background-color: var(--background-white);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.4s ease-in-out;
        z-index: 999;
    }
    .mobile-nav.active { left: 0; }
    .mobile-nav ul { list-style: none; padding: 0; }
    .mobile-nav li { margin: 1.5rem 0; text-align: center; }
    .mobile-nav a { font-size: 1.8rem; color: var(--text-dark); }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    #tools-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .modal-content {
        padding: 1.5rem;
        max-height: 95vh;
    }
    .modal-main {
        max-height: calc(95vh - 3rem);
    }
}