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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    cursor: none; /* Hide default cursor for quantum cursor */
}

.compression-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
}

/* Scene container for Three.js background */
#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10 !important;
    pointer-events: none;
}

/* Compression-themed lock styling */
.compression-lock-body {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 212, 255, 0.05) 50%, rgba(0, 212, 255, 0.02) 100%);
    border-radius: 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(0, 212, 255, 0.1), 0 0 20px rgba(0, 212, 255, 0.4);
    backdrop-filter: blur(10px);
    animation: compressionGlassShimmer 6s ease-in-out infinite;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 8px;
}

.compression-glass-reflection {
    position: absolute;
    top: 5px;
    left: 10px;
    right: 10px;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

.compression-combination-dial {
    position: absolute;
    width: 25px;
    height: 25px;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.15) 0%, rgba(0, 212, 255, 0.05) 100%);
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 255, 0.4);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.2), inset 0 1px 2px rgba(0, 212, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: compression-dial-spin 8s linear infinite;
}

.compression-center-dial {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 30px !important;
    height: 30px !important;
    background: linear-gradient(145deg, #00d4ff, #0099cc);
    box-shadow:
        0 0 15px rgba(0, 212, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    animation: compression-center-pulse 3s ease-in-out infinite;
}

.compression-dial-1 {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    animation: compression-dial-spin-1 8s linear infinite;
}

.compression-dial-2 {
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    animation: compression-dial-spin-2 8s linear infinite;
}

.compression-dial-3 {
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    animation: compression-dial-spin-3 8s linear infinite;
}

.compression-dial-4 {
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    animation: compression-dial-spin-4 8s linear infinite;
}

.compression-dial-number {
    font-size: 12px;
    color: #00d4ff;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
    user-select: none;
}

.compression-center-dial .compression-dial-number {
    font-size: 14px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes compression-dial-spin-1 {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

@keyframes compression-dial-spin-2 {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

@keyframes compression-dial-spin-3 {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

@keyframes compression-dial-spin-4 {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

@keyframes compression-center-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 15px rgba(0, 212, 255, 0.5),
            0 2px 4px rgba(0, 0, 0, 0.3),
            inset 0 1px 2px rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow:
            0 0 25px rgba(0, 212, 255, 0.8),
            0 4px 8px rgba(0, 0, 0, 0.4),
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
    }
}

@keyframes compressionGlassShimmer {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(0, 212, 255, 0.1), 0 0 20px rgba(0, 212, 255, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(0, 212, 255, 0.2), 0 0 30px rgba(0, 212, 255, 0.6);
    }
}

#scene-container canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: -10 !important;
    pointer-events: none !important;
    opacity: 0.8 !important;
    display: block !important;
    visibility: visible !important;
}

/* Force visibility of background animations */
body {
    position: relative;
}

.container {
    position: relative;
    z-index: 1;
}

.app-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
}

.three-d-container {
    height: 200px;
    margin-bottom: 2rem;
}

.main-title {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #00d4ff, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease-in-out infinite;
    margin-bottom: 1rem;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.4);
    position: relative;
    z-index: 2;
    letter-spacing: -2px;
}

.main-title::before {
    content: 'PQCrypta Compression';
    position: absolute;
    top: 0;
    left: 0;
    color: rgba(0, 212, 255, 0.2);
    z-index: -1;
    filter: blur(2px);
    transform: translate(2px, 2px);
}

.subtitle {
    font-size: 1.8rem;
    color: #b8c5d6;
    font-weight: 400;
    letter-spacing: 3px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.compression-interface {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.input-section {
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 3rem;
    padding-bottom: 4rem;
    min-height: calc(100% + 100px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 212, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.output-section {
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 3rem;
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 212, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.input-section:hover, .output-section:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.4);
}

.input-section::before, .output-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 212, 255, 0.02), rgba(255, 107, 107, 0.02), rgba(78, 205, 196, 0.02));
    z-index: -1;
    border-radius: 25px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-section:hover::before, .output-section:hover::before {
    opacity: 1;
}

.control-panel {
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    border-radius: 25px;
    padding: 3rem;
    border: 1px solid rgba(0, 212, 255, 0.25);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: relative;
    margin: 2rem 0;
}

.control-panel::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00d4ff, #ff6b6b, #4ecdc4, #45b7d1);
    border-radius: 25px;
    z-index: -1;
    opacity: 0.3;
    filter: blur(4px);
    animation: gradientRotate 8s linear infinite;
}

@keyframes gradientRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #00d4ff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-upload-zone {
    border: 2px dashed rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-upload-zone:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.file-upload-zone.dragover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.02);
}

.text-input {
    width: 100%;
    min-height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    color: #ffffff;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #b8c5d6;
    margin-top: 0.5rem;
}

.char-counter.warning {
    color: #ff6b6b;
    font-weight: 600;
}

.algorithm-selector {
    margin-bottom: 2rem;
}

.algorithm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.algorithm-option {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 0.8rem 0.6rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.algorithm-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.algorithm-option:hover::before {
    opacity: 1;
}

.algorithm-option:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(78, 205, 196, 0.15) 100%);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 15px rgba(0, 212, 255, 0.4);
}

.algorithm-option.selected {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3) 0%, rgba(78, 205, 196, 0.2) 100%);
    border-color: #00d4ff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(0, 212, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: scale(1.03);
}

.algorithm-option.selected::after {
    content: '⚡';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 1rem;
    color: #00d4ff;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
}

.algorithm-info {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 3px solid #00d4ff;
}

.algorithm-info h4 {
    color: #00d4ff;
    margin-bottom: 0.5rem;
}

.algorithm-info p {
    color: #b8c5d6;
    font-size: 0.9rem;
    line-height: 1.4;
}

.action-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons-output {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 212, 255, 0.25));
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 16px;
    padding: 1rem 2rem;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(0, 212, 255, 0.35));
    border-color: rgba(0, 212, 255, 0.6);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 25px rgba(0, 212, 255, 0.4);
}

.btn-compress {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(78, 205, 196, 0.15));
    border-color: rgba(0, 212, 255, 0.4);
}

.btn-compress:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(78, 205, 196, 0.25));
}

.btn-decompress {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 142, 83, 0.15));
    border-color: rgba(255, 107, 107, 0.4);
}

.btn-decompress:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.25), rgba(255, 142, 83, 0.25));
    border-color: rgba(255, 107, 107, 0.6);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 25px rgba(255, 107, 107, 0.4);
}

.btn:disabled {
    background: rgba(102, 102, 102, 0.2);
    color: rgba(153, 153, 153, 0.7);
    cursor: not-allowed;
    opacity: 0.5;
    border-color: rgba(102, 102, 102, 0.3);
}

.btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.output-container {
    position: relative;
    margin-bottom: 2rem;
}

.output-area {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 1rem;
    line-height: 1.6;
    min-height: 250px;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-y: auto;
    resize: vertical;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.output-area:focus {
    outline: none;
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 255, 0.2);
}

.output-area .copy-btn,
.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 8px;
    padding: 0;
    color: #00d4ff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    backdrop-filter: blur(15px);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}


.copy-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.stats-panel {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-panel.hidden {
    display: none;
}

.stat-item {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(45deg, #00d4ff, #ff6b6b, #4ecdc4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 255, 0.2);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #00d4ff;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.stat-label {
    font-size: 0.8rem;
    color: #b8c5d6;
    margin-top: 0.3rem;
}

.download-btn {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.15), rgba(68, 160, 141, 0.15));
    border-color: rgba(78, 205, 196, 0.4);
}

.hidden {
    display: none !important;
}

.download-btn.hidden {
    display: none;
}

.download-btn:hover {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.25), rgba(68, 160, 141, 0.25));
    border-color: rgba(78, 205, 196, 0.6);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 25px rgba(78, 205, 196, 0.4);
}

.upload-content {
    pointer-events: none;
}

.upload-file-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: #b8c5d6;
    font-size: 0.9rem;
}

.file-input-hidden {
    display: none;
}

.section-divider {
    text-align: center;
    margin: 1rem 0;
    color: #b8c5d6;
}

.error-message {
    color: #ff6b6b;
    font-weight: 600;
}

.success-message {
    color: #4ecdc4;
    font-weight: 600;
}

/* Enhanced tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    margin-bottom: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Enhanced animations */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    }
}

.loading {
    animation: pulse 2s infinite;
    position: relative;
    overflow: hidden;
}

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

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

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

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

@media (max-width: 1200px) {
    .compression-interface {
        gap: 1.5rem;
    }

    .algorithm-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .app-container {
        padding: 1rem;
    }

    .algorithm-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .input-section, .output-section, .control-panel {
        padding: 2rem;
    }
}

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

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

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

/* Center copyright - integrate with page */
.legal-notice {
    text-align: center;
    padding: 1rem;
    background: transparent;
    color: #b8c5d6;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.legal-notice-center {
    text-align: center;
    margin: 0 auto;
    max-width: 100%;
}

.legal-notice p {
    margin: 0;
    padding: 0;
}

/* Enhanced Character Counter Styles */
.char-counter {
    font-size: 0.9rem !important;
    margin-top: 0.75rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0.75rem !important;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    transform: translateY(25px) !important;
    position: static !important;
    display: block !important;
    width: auto !important;
    max-width: 500px !important;
}

.char-counter.good {
    color: #4ecdc4;
    border-color: rgba(78, 205, 196, 0.3);
    background: rgba(78, 205, 196, 0.1);
}

.char-counter.warning {
    color: #feca57;
    border-color: rgba(254, 202, 87, 0.3);
    background: rgba(254, 202, 87, 0.1);
}

.char-counter.danger {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
    background: rgba(255, 107, 107, 0.1);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Enhanced File Upload Zone */
.char-warning {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 0.85rem;
}

.compression-estimate {
    color: #4ecdc4;
    font-size: 0.85rem;
    font-style: italic;
}

/* Enhanced Algorithm Info Panel */
.algorithm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.algorithm-header h4 {
    margin: 0;
    color: #00d4ff;
    font-size: 1.4rem;
}

.algorithm-category {
    background: linear-gradient(135deg, #00d4ff, #4ecdc4);
    color: #000;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.algorithm-description {
    margin: 0;
    padding: 0;
    margin-bottom: 0.5rem;
    min-height: auto;
    height: auto;
}

.algorithm-description p {
    color: #b8c5d6;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    display: block;
    height: auto;
    min-height: auto;
}

.algorithm-specs {
    margin-bottom: 1.5rem;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}

.spec-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.8rem;
    transition: all 0.3s ease;
}

.spec-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.spec-item label {
    display: block;
    font-size: 0.8rem;
    color: #8a92a5;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.spec-item value {
    display: block;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

/* CPU Intensive Color Coding */
.cpu-none, .cpu-very-low, .cpu-low {
    color: #4ecdc4 !important;
}

.cpu-medium {
    color: #feca57 !important;
}

.cpu-high, .cpu-very-high, .cpu-extreme, .cpu-maximum {
    color: #ff6b6b !important;
}

/* Algorithm Recommendation */
.algorithm-recommendation {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(78, 205, 196, 0.1) 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.recommendation {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.recommendation-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.recommendation {
    color: #e8f4f8;
    line-height: 1.4;
    font-size: 0.95rem;
}

/* Responsive adjustments for enhanced features */
@media (max-width: 768px) {
    .spec-grid {
        grid-template-columns: 1fr;
    }

    .algorithm-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .algorithm-category {
        align-self: flex-end;
    }
}