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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    position: relative;
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

.upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.upload-label svg {
    color: #667eea;
}

.upload-label span {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.upload-label small {
    color: #666;
    font-size: 0.9em;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f0f2ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.file-info p {
    margin: 5px 0;
}

.compression-mode {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
}

.compression-mode label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 1em;
}

.compression-mode select {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compression-mode select:hover {
    border-color: #764ba2;
}

.compression-mode select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mode-hint {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-download {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(17, 153, 142, 0.4);
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    border-left: 4px solid #f00;
    color: #c00;
}

.alert-success {
    background: #efe;
    border-left: 4px solid #0a0;
    color: #060;
}

.alert-warning {
    background: #fff8e1;
    border-left: 4px solid #ff9800;
    color: #e65100;
}

.result-section {
    margin-top: 30px;
}

.comparison-card {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 20px;
    margin: 30px 0;
    padding: 30px;
    background: #f8f9ff;
    border-radius: 12px;
    flex-wrap: wrap;
}

.comparison-item {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comparison-item.compressed {
    border: 2px solid #38ef7d;
}

.comparison-item h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.filename {
    font-weight: 600;
    margin: 10px 0;
    word-break: break-all;
}

.size {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
}

.savings {
    color: #38ef7d;
    font-weight: bold;
    font-size: 1.2em;
    margin-top: 10px;
}

.arrow {
    font-size: 2em;
    color: #667eea;
}

.download-section {
    text-align: center;
    margin-top: 30px;
}

.api-info {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.api-info h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    white-space: pre;
}

footer {
    background: #f8f9ff;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

footer code {
    background: #e8ebff;
    padding: 2px 6px;
    border-radius: 4px;
    color: #667eea;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    main {
        padding: 20px;
    }
    
    .comparison-card {
        flex-direction: column;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
}

