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

:root {
    --primary-red: #ff3b30;
    --dark-red: #d32f2f;
    --accent-red: #ff6659;
    --bg-black: #000000;
    --bg-dark: #0a0a0a;
    --bg-card: rgba(20, 20, 20, 0.8);
    --text-white: #ffffff;
    --text-gray: #b0b0b0;
    --border-color: rgba(255, 59, 48, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a0000 50%, #000000 100%);
    color: var(--text-white);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 59, 48, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 59, 48, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 59, 48, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.6s ease-out;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-red), var(--accent-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-gray);
    font-size: 1.1rem;
    font-weight: 300;
}

main {
    animation: fadeInUp 0.6s ease-out;
}

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

.drop-zone {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 2px dashed var(--border-color);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 59, 48, 0.1), transparent);
    transition: left 0.5s;
}

.drop-zone:hover::before {
    left: 100%;
}

.drop-zone:hover {
    border-color: var(--primary-red);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(255, 59, 48, 0.2);
}

.drop-zone.drag-over {
    border-color: var(--primary-red);
    background: rgba(255, 59, 48, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: var(--primary-red);
    margin: 0 auto 20px;
    filter: drop-shadow(0 4px 12px rgba(255, 59, 48, 0.3));
}

.drop-text {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-white);
}

.drop-subtext {
    color: var(--text-gray);
    font-size: 1rem;
    margin-bottom: 20px;
}

.supported-formats {
    color: var(--text-gray);
    font-size: 0.9rem;
    opacity: 0.7;
}

.file-info {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    animation: slideIn 0.4s ease-out;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-red), var(--accent-red));
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-meta {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.remove-btn {
    background: rgba(255, 59, 48, 0.2);
    border: none;
    color: var(--primary-red);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.remove-btn:hover {
    background: var(--primary-red);
    color: white;
    transform: rotate(90deg);
}

.compression-section {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 30px;
    animation: slideIn 0.4s ease-out;
}

.size-selector label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-white);
}

.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

#targetSize {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s;
}

#targetSize:focus {
    outline: none;
    border-color: var(--primary-red);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

.unit {
    color: var(--text-gray);
    font-weight: 600;
    font-size: 1.1rem;
}

.size-info {
    color: var(--text-gray);
    font-size: 0.9rem;
    min-height: 20px;
}

#compressionRatio {
    color: var(--accent-red);
}

.compress-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    border: none;
    border-radius: 16px;
    padding: 18px 32px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    margin-top: 24px;
    box-shadow: 0 8px 24px rgba(255, 59, 48, 0.3);
}

.compress-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 59, 48, 0.4);
}

.compress-btn:active {
    transform: translateY(0);
}

.btn-icon {
    width: 24px;
    height: 24px;
}

.progress-section {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    animation: slideIn 0.4s ease-out;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-red), var(--accent-red));
    height: 100%;
    width: 0%;
    transition: width 0.3s ease-out;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.5);
}

.progress-text {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.95rem;
}

.result-section {
    animation: slideIn 0.4s ease-out;
}

.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 48px 32px;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-red), var(--accent-red));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-card h2 {
    font-size: 1.8rem;
    margin-bottom: 32px;
    font-weight: 600;
}

.result-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-white);
}

.stat-arrow {
    font-size: 1.5rem;
    color: var(--primary-red);
}

.download-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    border: none;
    border-radius: 16px;
    padding: 18px 32px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(255, 59, 48, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 59, 48, 0.4);
}

.download-btn svg {
    width: 24px;
    height: 24px;
}

.new-file-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 32px;
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.new-file-btn:hover {
    border-color: var(--primary-red);
    color: var(--text-white);
    background: rgba(255, 59, 48, 0.1);
}

.hidden {
    display: none !important;
}

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 20px 16px;
    }
    
    .drop-zone {
        padding: 40px 20px;
    }
    
    .upload-icon {
        width: 60px;
        height: 60px;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 16px;
    }
    
    .stat-arrow {
        transform: rotate(90deg);
    }
}
