/*
Theme Name: Compressor Pro
Description: WordPress theme with integrated image compression tool
Version: 2.0
Author: Mehdi Name
*/

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header Styles */
.header {
    background: #fff;
    border-bottom: 1px solid #e1e8ed;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a73e8;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    background: linear-gradient(45deg, #1a73e8, #4285f4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: #5f6368;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 4px;
    position: relative;
}

.nav-links a:hover,
.nav-links a:focus {
    color: #1a73e8;
    background: rgba(26, 115, 232, 0.1);
    outline: none;
}

.nav-links a:focus {
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.4);
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 30px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #202124;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 16px;
    color: #4d4f52;
    max-width: 900px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.inside-subtitle {
    font-size: 16px;
    color: #4d4f52;
    max-width: 900px;
    margin: 0 auto 20px;
    line-height: 1.6;
    text-align: left;
}

.inside-subtitle p {
    margin: 1em 0;
    font-size: 1.1em;
}

.inside-subtitle h2, .inside-subtitle h3 {
    font-size: 1.3em;
    color: #202124;
    margin: 1.5em 0 0.5em 0;
}

svg.header__line {
    display: inline-block;
    vertical-align: top;
    height: 2px;
    width: 100%;
    margin: 0.5em 0;
    stroke: #c0d5f4;
    stroke-dasharray: 5 7;
    stroke-dashoffset: 0;
    stroke-width: 1px;
}

/* Main Section */
.main-section {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    position: relative;
}

/* Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.upload-btn, .clear-btn {
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    justify-content: center;
}

.upload-btn {
    background: #4285f4;
    color: white;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.upload-btn:hover, .upload-btn:focus {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
    outline: none;
}

.upload-btn:focus {
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4), 0 0 0 2px rgba(66, 133, 244, 0.3);
}

.clear-btn {
    background: #ea4335;
    color: white;
    box-shadow: 0 2px 8px rgba(234, 67, 53, 0.3);
}

.clear-btn:hover, .clear-btn:focus {
    background: #d33b2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.4);
    outline: none;
}

.clear-btn:focus {
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.4), 0 0 0 2px rgba(234, 67, 53, 0.3);
}

/* Drop Zone */
.drop-zone {
    border: 3px dashed #dadce0;
    border-radius: 12px;
    padding: 80px 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafbfc;
    position: relative;
    min-height: 200px;
}

.drop-zone.has-images {
    padding: 20px;
    border: 1px solid #e8eaed;
    background: #fff;
}

.drop-zone.has-images .drop-zone-content {
    display: none;
}

.drop-zone:hover,
.drop-zone.dragover,
.drop-zone:focus-within {
    border-color: #4285f4;
    background: #f1f3ff;
    transform: scale(1.01);
}

.drop-zone-content h2 {
    font-size: 1.8rem;
    color: #5f6368;
    margin-bottom: 15px;
    font-weight: 400;
}



/* Download Section */
.download-section {
    text-align: center;
    margin-top: 30px;
}

.download-all-btn {
    background: #5f6368;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    min-width: 180px;
    justify-content: center;
}

.download-all-btn:hover:not(:disabled),
.download-all-btn:focus:not(:disabled) {
    background: #3c4043;
    transform: translateY(-2px);
    outline: none;
}

.download-all-btn:focus:not(:disabled) {
    box-shadow: 0 0 0 2px rgba(95, 99, 104, 0.4);
}

.download-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.download-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ea4335;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.file-input {
    display: none;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-item {
    border: 1px solid #e8eaed;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.image-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.image-preview-container {
    position: relative;
    height: 220px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Comparison Slider */
.comparison-container {
    position: relative;
    height: 220px;
    width: 100%;
    overflow: hidden;
}

.comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    background: #4285f4;
    cursor: ew-resize;
    z-index: 10;
    box-shadow: 0 0 0 2px white;
    border-radius: 2px;
}

.comparison-slider::before {
    content: '↔';
    position: absolute;
    top: 50%;
    left: -12px;
    width: 28px;
    height: 28px;
    background: #4285f4;
    border-radius: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid white;
}

.comparison-container::after {
    content: 'Original ← → Compressed';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 15;
}

.image-original,
.image-compressed {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.image-original {
    clip-path: inset(0 50% 0 0);
}

.image-compressed {
    clip-path: inset(0 0 0 50%);
}

/* Image Info */
.image-info {
    padding: 20px;
}

.image-name {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 12px;
    word-break: break-all;
}

.image-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 13px;
    color: #5f6368;
    gap: 10px;
}

.size-reduction {
    color: #137333;
    font-weight: 600;
}

/* Quality Control */
.quality-control {
    margin-bottom: 20px;
}

.quality-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #5f6368;
}

.quality-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e8eaed;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.quality-slider:focus {
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.4);
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4285f4;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.quality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4285f4;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Image Actions */
.image-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #fff;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover:not(:disabled),
.btn:focus:not(:disabled) {
    background: #f8f9fa;
    border-color: #4285f4;
    outline: none;
}

.btn:focus:not(:disabled) {
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus:not(:disabled) {
    background: #3367d6;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e8eaed;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4285f4, #34a853);
    width: 0%;
    transition: width 0.3s ease;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8eaed 100%);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e8eaed;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #4285f4;
    display: block;
}

.stat-label {
    font-size: 14px;
    color: #5f6368;
    margin-top: 5px;
}

/* Feature Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    transition: all 0.3s ease;
}

.feature-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(45deg, #4285f4, #34a853);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 15px;
}

.feature-title {
    font-size: 18px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 10px;
}

.feature-description {
    font-size: 14px;
    color: #5f6368;
    line-height: 1.6;
}

/* Info Section */
.info-section {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.info-section h2 {
    font-size: 1.5rem;
    color: #202124;
    margin-bottom: 20px;
    font-weight: 600;
    position: relative;
}

.info-section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #4285f4, #34a853);
    border-radius: 2px;
}

.info-section h3 {
    font-size: 1.3rem;
    color: #202124;
    margin: 25px 0 15px 0;
    font-weight: 600;
}

.info-section p {
    color: #5f6368;
    margin-bottom: 16px;
    line-height: 1.7;
    font-size: 16px;
}

.info-section p:last-child {
    margin-bottom: 0;
}

.info-section ul {
    margin: 15px 0;
    padding-left: 20px;
}

.info-section li {
    color: #5f6368;
    margin-bottom: 8px;
    line-height: 1.6;
}

.info-section strong {
    color: #202124;
}

/* FAQ Styles */
details {
    margin-bottom: 15px;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    overflow: hidden;
}

summary {
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    color: #202124;
    border-bottom: 1px solid #e8eaed;
    transition: background 0.2s;
}

summary:hover {
    background: #f1f3ff;
}

details[open] summary {
    background: #e8f0fe;
}

details p {
    padding: 15px 20px;
    margin: 0;
    background: white;
}

/* Footer */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e8eaed;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #202124;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #5f6368;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-section a:hover,
.footer-section a:focus {
    color: #1a73e8;
    outline: none;
}

.footer-bottom {
    text-align: center;
    color: #5f6368;
    font-size: 14px;
    padding-top: 20px;
    border-top: 1px solid #e8eaed;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .btn, .upload-btn, .clear-btn, .download-all-btn {
        border: 2px solid;
    }

    .drop-zone {
        border-width: 4px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        gap: 15px;
        padding: 10px 20px;
    }

    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: 2rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .upload-btn, .clear-btn {
        width: 100%;
        max-width: 300px;
    }

    .drop-zone {
        padding: 40px 20px;
        min-height: 150px;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .main-section {
        padding: 20px;
    }

    .info-section {
        padding: 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .image-stats {
        flex-direction: column;
        gap: 5px;
    }

    .quality-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Print Styles */
@media print {
    .header, .footer {
        display: none;
    }

    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .main-section, .info-section {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Focus visible polyfill */
.js-focus-visible :focus:not(.focus-visible) {
    outline: none;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Cookie Notice */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #202124;
    color: white;
    padding: 15px 20px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-notice.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-text {
    font-size: 14px;
    line-height: 1.4;
}

.cookie-text a {
    color: #4285f4;
    text-decoration: none;
}

.cookie-text a:hover {
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 10px;
}

.cookie-btn {
    padding: 8px 16px;
    border: 1px solid #5f6368;
    background: transparent;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.cookie-btn:hover,
.cookie-btn:focus {
    background: #5f6368;
    outline: none;
}

.cookie-btn.primary {
    background: #4285f4;
    border-color: #4285f4;
}

.cookie-btn.primary:hover,
.cookie-btn.primary:focus {
    background: #3367d6;
    border-color: #3367d6;
}

/* Mobile responsive for cookie bar */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-actions {
        justify-content: center;
    }
}