/**
 * Stylesheet für Bildkomprimierung
 * Dateipfad: /image-compressor/assets/css/style.css
 */

/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
}

header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Sprachauswahl - Verbesserte Styles */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-dropdown {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%228%22%20viewBox%3D%220%200%2014%208%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%201l6%206%206-6%22%20stroke%3D%22%232c3e50%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.language-dropdown:hover {
    border-color: #3498db;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.15);
}

.language-dropdown:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.language-dropdown option {
    padding: 10px;
    font-weight: normal;
}

/* Dark Mode Support für Sprachauswahl
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    header,
    .upload-section,
    .analysis-section,
    .results-section {
        background-color: #2c2c2c;
        color: #e0e0e0;
    }
    
    .language-dropdown {
        background-color: #3c3c3c;
        color: #e0e0e0;
        border-color: #4a4a4a;
        background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%228%22%20viewBox%3D%220%200%2014%208%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%201l6%206%206-6%22%20stroke%3D%22%23e0e0e0%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E');
    }
    
    .language-dropdown:hover {
        border-color: #5a9fd4;
        background-color: #454545;
    }
}
*/
/* Upload-Bereich */
.upload-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #3498db;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    position: relative;
}

.upload-area:hover {
    border-color: #2980b9;
    background-color: #e8f4f8;
}

.upload-area.drag-over {
    border-color: #27ae60;
    background-color: #e8f5e9;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.upload-area:hover .upload-icon {
    transform: scale(1.1);
}

.upload-info {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Fortschrittsanzeige */
.progress-section {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: #ecf0f1;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    transition: width 0.3s ease;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.1) 75%,
        transparent 75%,
        transparent
    );
    background-size: 30px 30px;
    animation: progress-animation 1s linear infinite;
}

@keyframes progress-animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 30px 30px;
    }
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
    font-weight: 500;
}

/* Dateiliste */
.file-list {
    margin-top: 30px;
}

.file-list h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.file-list ul {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px;
}

.file-list li {
    padding: 12px 15px;
    background-color: #f8f9fa;
    margin-bottom: 5px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.file-list li:hover {
    background-color: #e8f4f8;
    transform: translateX(5px);
}

.file-list li.error {
    background-color: #ffe6e6;
    color: #c0392b;
    border-left: 4px solid #c0392b;
}

.file-list li.error:hover {
    background-color: #ffd0d0;
}

/* Analyse-Bereich */
.analysis-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.analysis-results {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.analysis-summary h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.analysis-summary p {
    margin: 10px 0;
    line-height: 1.8;
}

#estimatedSavings {
    transition: all 0.3s ease;
    background-color: #e8f4f8;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #3498db;
}

#estimatedSavings.savings-negative {
    background-color: #ffe6e6;
    border-left-color: #e74c3c;
}

/* Format-Auswahl */
.format-selection {
    margin-top: 30px;
}

.format-selection h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.format-options {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.format-option {
    flex: 1;
    min-width: 150px;
}

.format-option input[type="radio"] {
    display: none;
}

.format-option label {
    display: block;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.format-option label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: left 0.5s ease;
}

.format-option label:hover::before {
    left: 100%;
}

.format-option input[type="radio"]:checked + label {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.format-option label:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Qualitäts-Einstellungen */
.quality-settings {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.quality-settings label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #2c3e50;
}

.quality-settings input[type="range"] {
    width: 100%;
    margin: 10px 0;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.quality-settings input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3498db;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.quality-settings input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

.quality-settings input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3498db;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#qualityValue {
    display: inline-block;
    width: 50px;
    text-align: center;
    font-weight: bold;
    color: #3498db;
    font-size: 1.2em;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.btn-primary:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover {
    box-shadow: none;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

/* Ergebnis-Bereich */
.results-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.results-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.result-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.result-thumbnail {
    width: 100%;
    height: 300px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.result-item:hover .result-thumbnail {
    transform: scale(1.05);
}

.result-info {
    padding: 15px;
}

.result-info h4 {
    margin-bottom: 10px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-stats {
    font-size: 0.9em;
    color: #7f8c8d;
}

.result-stats p {
    margin: 5px 0;
}

.savings-positive {
    color: #27ae60;
    font-weight: bold;
}

.savings-negative {
    color: #e74c3c;
}

/* Download-Optionen */
.download-options {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.download-options h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.download-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.download-buttons .btn {
    margin: 5px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .language-selector {
        position: relative;
        top: auto;
        right: auto;
        text-align: center;
        margin-top: 15px;
    }
    
    .language-dropdown {
        width: 100%;
        max-width: 200px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .format-options {
        flex-direction: column;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Messages */
.error-message,
.success-message,
.info-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Error Messages */
.error-message {
    background-color: #ffe6e6;
    color: #c0392b;
    border-left-color: #c0392b;
}

/* Success Messages */
.success-message {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #155724;
}

/* Info Messages */
.info-message {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: #0c5460;
}

/* Info Box */
.info-box {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    border-left: 4px solid #0c5460;
}

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

/* Focus Styles */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .language-selector,
    .upload-section,
    .btn,
    footer {
        display: none;
    }
    
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}