@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Space+Mono:wght@400;700&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.color-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    transition: background 0.5s ease;
}

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

.header {
    text-align: center;
    margin-bottom: 60px;
}

.title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 16px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 60px;
}

.visualizer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

#waveCanvas {
    width: 100%;
    height: 300px;
    margin-bottom: 40px;
}

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

.color-hex {
    font-family: 'Space Mono', monospace;
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 12px;
}

.color-name {
    font-size: 1.5rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-icon {
    font-size: 1.5rem;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a3e;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

.stats {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    display: grid;
    gap: 16px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
}

.color-history {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
}

.color-history h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    opacity: 0.9;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.history-color {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.history-color:hover {
    transform: scale(1.1);
}

.info-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
}

.info-section h3 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.info-card {
    text-align: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.info-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.info-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.info-card p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.6;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .history-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}