@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&display=swap');

/* General Body Styles */
body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: #f4f7f9;
    color: #333;
}

/* Header */
header {
    background-color: #fff;
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
    color: #2c3e50;
}

header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* Main Content */
main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.tool-card h3 {
    margin: 0 0 0.5rem 0;
    color: #3498db;
}

/* Sections */
section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.seo-text {
    margin-top: 3rem;
}

h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

footer nav {
    margin: 1rem 0;
}

footer nav a {
    color: #3498db;
    text-decoration: none;
    margin: 0 10px;
}

footer nav a:hover {
    text-decoration: underline;
}

/* Ad Slots */
.ad-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.9rem;
    border-radius: 8px;
    margin: 1.5rem auto;
    max-width: 728px;
}

/* Tool Page Specific Styles */
.tool-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.upload-area.drag-over {
    background-color: #eaf5ff;
}

.upload-area p {
    margin: 0;
    font-size: 1.1rem;
    color: #555;
}

.upload-area .file-input-label {
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
}

/* Compressor Specific Styles */
.upload-area-large {
    border: 3px dashed #d0d7de;
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    background-color: #fafbfc;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.upload-area-large:hover {
    border-color: #3498db;
    background-color: #f0f7ff;
}

.upload-area-large.drag-over {
    border-color: #3498db;
    background-color: #e3f2fd;
    border-style: solid;
}

.upload-icon {
    color: #95a5a6;
    margin-bottom: 1rem;
}

.upload-area-large h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 1rem 0 0.5rem 0;
}

.upload-text {
    font-size: 1rem;
    color: #7f8c8d;
    margin: 0.5rem 0;
}

.upload-info {
    font-size: 0.875rem;
    color: #95a5a6;
    margin: 0.5rem 0 0 0;
}

#file-input {
    display: none;
}

.options {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.results {
    margin-top: 2rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
    }
}

.option {
    display: flex;
    flex-direction: column;
}

.option label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.option input[type="range"], .option input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.option input[type="range"] {
    padding: 0;
}

.option input[type="checkbox"] {
    width: auto;
}

.option .range-value {
    font-weight: bold;
    color: #3498db;
}

.btn {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn:hover, .btn:focus {
    background-color: #2980b9;
}

.btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#compress-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

#compress-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#compress-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* Preset buttons */
.preset-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid #3498db;
    background-color: #fff;
    color: #3498db;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.preset-btn:hover {
    background-color: #eaf5ff;
}

.preset-btn.active {
    background-color: #3498db;
    color: #fff;
}

#preview-area {
    margin-top: 1.5rem;
    text-align: center;
    background-color: #fafbfc;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

#preview-area.active {
    display: block;
}

#preview-area img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#result-info {
    margin-top: 1.5rem;
    padding: 1rem;
    font-size: 1rem;
    color: #2c3e50;
    background-color: #e8f5e9;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

#comparison-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-highlight .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-highlight .stat-value {
    color: white;
}

#progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 1rem;
    display: none;
}

#progress-bar-fill {
    width: 0;
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s;
}

#error-message {
    color: #e74c3c;
    margin-top: 1rem;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    .tool-container {
        padding: 1.5rem;
    }
}
