/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    color: #333;
    min-height: 100vh;
}

nav {
    background: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e9ecef;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

nav ul li {
    margin: 0 15px;
    position: relative;
}

nav ul li a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
}

nav ul li a:hover {
    background-color: #f8f9fa;
    color: #007bff;
    transform: translateY(-2px);
}
/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: #ffffff;
    min-width: 220px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1001;
    margin-top: 5px;
    border: 1px solid #e9ecef;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-content a {
    color: #2c3e50;
    padding: 14px 20px;
    text-decoration: none;
    display: block;
    text-align: left;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
    border-left-color: #007bff;
    color: #007bff;
    padding-left: 25px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.container {
    max-width: 900px;
    margin: 50px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    text-align: center;
    animation: fadeIn 0.6s ease;
    border: 1px solid #e9ecef;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 15px;
    font-weight: 700;
}

.container > p {
    color: #6c757d;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.tool-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.tool-card {
    background: #ffffff;
    padding: 30px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #007bff;
}

.tool-card h2 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
}

.tool-card p {
    color: #6c757d;
    font-size: 0.95em;
    line-height: 1.5;
}

.settings {
    text-align: left;
    margin: 30px 0;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.settings label {
    display: block;
    margin: 15px 0 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95em;
}

.settings input[type="range"],
.settings input[type="number"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    transition: border-color 0.3s ease;
    font-size: 1em;
    background: #ffffff;
}

.settings input[type="range"]:focus,
.settings input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
}

.settings input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #007bff;
}

#drop-area {
    border: 2px dashed #ced4da;
    padding: 40px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

#drop-area:hover {
    background: #e9ecef;
    border-color: #007bff;
}

#drop-area.dragover {
    background: #e7f1ff;
    border-color: #007bff;
    transform: scale(1.02);
}

#file-input {
    display: none;
}

#file-label {
    display: inline-block;
    padding: 12px 30px;
    background: #007bff;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

#file-label:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

#file-names {
    display: block;
    margin-top: 15px;
    color: #495057;
    font-weight: 600;
}

#preview {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

#preview img {
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 2px solid #e9ecef;
}

#preview img:hover {
    transform: scale(1.05);
    border-color: #007bff;
}

#convert-btn,
#compress-btn {
    margin-top: 30px;
    padding: 12px 35px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

#convert-btn:hover,
#compress-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

#convert-btn:disabled,
#compress-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-top: 25px;
    overflow: hidden;
}

#progress-bar {
    width: 0;
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
    border-radius: 5px;
}

#loading-spinner {
    margin-top: 30px;
}

.spinner {
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-spinner p {
    margin-top: 15px;
    color: #495057;
    font-weight: 600;
    font-size: 1em;
}

#output {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-weight: 600;
}

.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 20px 10px;
        padding: 25px 20px;
    }
    
    .container h1 {
        font-size: 1.8em;
    }
    
    .container > p {
        font-size: 1em;
    }
    
    .tool-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    nav {
        padding: 10px 15px;
    }
    
    nav ul {
        flex-direction: column;
        align-items: stretch;
    }
    
    nav ul li {
        margin: 5px 0;
    }
    
    nav ul li a {
        text-align: center;
    }
    
    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid #e9ecef;
        border-radius: 0;
        margin-top: 0;
    }
    
    .dropdown:hover .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        border-left: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .dropdown-content a:hover {
        padding-left: 20px;
    }
    
    #file-label {
        padding: 10px 20px;
        font-size: 0.95em;
    }
    
    #convert-btn,
    #compress-btn {
        padding: 10px 25px;
        font-size: 1em;
    }
}