/* ====================== */
/* === BASE STYLES === */
/* ====================== */
:root {
    /* Color Variables */
    --primary-color: #4a6bff;
    --primary-hover: #3a5bef;
    --secondary-color: #6c757d;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --success-hover: #218838;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --white: #ffffff;
    --black: #000000;
    --gray: #6c757d;
    --light-gray: #f1f1f1;
    --border-color: #e9ecef;
    
    /* Spacing Variables */
    --section-gap: 5rem; /* 80px */
    --section-gap-lg: 6rem; /* 96px */
    --section-gap-sm: 3rem; /* 48px */
    
    /* Effect Variables */
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ====================== */
/* === HEADER STYLES === */
/* ====================== */
header {
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    gap: 0.5rem;
}

.logo i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-menu li a {
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.nav-menu li a:hover {
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
}

/* ====================== */
/* === HERO SECTION === */
/* ====================== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: var(--section-gap-lg) 0;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* ====================== */
/* === MAIN SECTIONS === */
/* ====================== */
.section {
    padding: var(--section-gap) 0;
}

.section:first-of-type {
    padding-top: var(--section-gap);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.section-header p {
    color: var(--secondary-color);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 1.25rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--primary-color);
}

.tool-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #6a8eff 100%);
    box-shadow: 0 4px 10px rgba(74, 107, 255, 0.3);
}

.tool-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Features Section */
.features-section {
    background-color: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    background-color: var(--light-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #6a8eff 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 10px rgba(74, 107, 255, 0.3);
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* ====================== */
/* === FOOTER STYLES === */
/* ====================== */
footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: var(--section-gap) 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 1.25rem;
}

.footer-brand p {
    opacity: 0.8;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.link-group h4 {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.link-group h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.link-group ul li {
    margin-bottom: 0.75rem;
}

.link-group ul li a {
    opacity: 0.8;
    transition: var(--transition);
    display: inline-block;
}

.link-group ul li a:hover {
    opacity: 1;
    color: var(--primary-color);
    transform: translateX(5px);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
    font-size: 0.95rem;
}

/* ====================== */
/* === BUTTON STYLES === */
/* ====================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: white;
    color: #4a4a4a;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #f8f8f8;
    border-color: #d0d0d0;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ====================== */
/* === CONVERTER SECTION === */
/* ====================== */
.converter-section {
    padding: 3.75rem 0;
    background-color: var(--white);
}

.converter-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.converter-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.9375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9375rem;
}

.converter-header p {
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto;
}

.converter-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.875rem;
    margin-bottom: 1.875rem;
}

.upload-panel, .options-panel {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.5625rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

.drop-zone {
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(74, 107, 255, 0.03);
    position: relative;
}

.drop-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-content {
    pointer-events: none;
}

.browse-link {
    pointer-events: auto;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

.drop-zone:hover {
    background: rgba(74, 107, 255, 0.1);
    border-color: var(--primary-hover);
}

.drop-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.9375rem;
}

.drop-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.3125rem;
    color: var(--dark-color);
}

.drop-content p {
    color: var(--secondary-color);
    margin-bottom: 0.9375rem;
}

.formats {
    font-size: 0.9rem;
    color: var(--gray);
}

.file-preview {
    margin-top: 1.5625rem;
}

.preview-list {
    max-height: 18.75rem;
    overflow-y: auto;
    margin: 0.9375rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
}

.preview-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.125rem;
    background: white;
    border-radius: 0.625rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.preview-item:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-color: #e0e0e0;
}

.preview-thumbnail {
    width: 3.125rem;
    height: 3.125rem;
    border-radius: 0.5rem;
    margin-right: 0.9375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.preview-info {
    flex: 1;
    min-width: 0;
}

.preview-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 0.8rem;
    color: #777;
}

.preview-remove {
    background: none;
    border: none;
    color: #ff4d4f;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 0.625rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.preview-remove:hover {
    background: rgba(255, 77, 79, 0.1);
    transform: scale(1.1);
}

.action-buttons {
    display: flex;
    gap: 0.9375rem;
    margin-top: 1.5625rem;
    flex-wrap: wrap;
}

.advanced-options {
    margin-top: 1.25rem;
}

.advanced-options h3 {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--dark-color);
}

.options-grid {
    display: grid;
    gap: 0.9375rem;
}

.option-card {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 0.9375rem;
    border: 1px solid var(--border-color);
}

.option-card label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0.625rem;
    color: var(--dark-color);
}

.styled-select {
    width: 100%;
    padding: 0.625rem 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
    font-family: inherit;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 1em;
}

.styled-select:hover {
    border-color: var(--primary-color);
}

.styled-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.2);
}

.results-section {
    margin-top: 2.5rem;
    padding-top: 1.875rem;
    border-top: 1px solid #f0f0f0;
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: 1.25rem;
    margin: 1.5625rem 0;
}

.result-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 0.9375rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-0.3125rem);
    box-shadow: 0 0.625rem 1.5625rem rgba(0, 0, 0, 0.1);
}

.result-thumbnail {
    width: 100%;
    height: 7.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    margin-bottom: 0.625rem;
    background: var(--light-color);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    font-size: 2.5rem;
}

.result-info {
    margin: 0.625rem 0;
}

.result-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-size {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-top: 0.3125rem;
}

.download-btn {
    background-color: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    width: 100%;
    margin-top: 0.625rem;
    border: none;
    outline: none;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-btn:hover {
    background-color: var(--success-hover);
    transform: translateY(-0.0625rem);
}

.btn-download-all {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.25rem;
    margin-top: 1.25rem;
    border: none;
    outline: none;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-download-all:hover {
    background-color: var(--primary-hover);
    transform: translateY(-0.0625rem);
}

.download-all-container {
    text-align: center;
    margin-top: 1.875rem;
}

.converting {
    position: relative;
    color: transparent !important;
}

.converting::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.conversion-progress {
    padding: 10px;
    background: #e7f1ff;
    color: #0a58ca;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #343a40;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.alert-message.fade-out {
    opacity: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Logo Animation */
.logo-icon {
    width: 40px;
    height: 40px;
    background: 
        radial-gradient(circle at center, white 30%, transparent 30%),
        conic-gradient(
            #4A6BFF 0% 25%, 
            #764BA2 25% 50%, 
            #6A8EFF 50% 75%, 
            #FCB69F 75% 100%
        );
    border-radius: 50%;
    position: relative;
    animation: spin 3s linear infinite;
}

.logo-icon::before {
    content: "↻";
    position: absolute;
    font-size: 24px;
    color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ====================== */
/* === RESPONSIVE STYLES === */
/* ====================== */
@media (max-width: 992px) {
    :root {
        --section-gap: 4rem;
        --section-gap-lg: 5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --section-gap: 3rem;
        --section-gap-lg: 4rem;
    }
    
    .navbar {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
        padding-top: 1rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .converter-split-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    :root {
        --section-gap: 2.5rem;
        --section-gap-lg: 3rem;
        --section-gap-sm: 2rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .tools-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}