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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
}

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.camera-container {
    position: relative;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#camera {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    min-height: 200px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.spectrum-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.spectrum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.spectrum-header h2 {
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
}

.spectrum-toggle {
    display: flex;
    gap: 5px;
}

.toggle-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.toggle-btn.active {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border-color: #4CAF50;
}

#spectrumCanvas {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.spectrum-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.color-values {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 4px solid;
}

.color-value:nth-child(1) {
    border-left-color: #ff4444;
}

.color-value:nth-child(2) {
    border-left-color: #44ff44;
}

.color-value:nth-child(3) {
    border-left-color: #4444ff;
}

.label {
    font-weight: 600;
    opacity: 0.9;
}

.dominant-color {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.color-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #333;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .spectrum-info {
        grid-template-columns: 1fr;
    }

    .spectrum-header {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .spectrum-toggle {
        width: 100%;
        justify-content: center;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary, .btn-secondary {
        width: 200px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .spectrum-container {
        padding: 15px;
    }

    #spectrumCanvas {
        height: 200px;
    }
}

@supports (backdrop-filter: blur(10px)) {
    .app-container::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="g"><stop offset="0%" stop-color="rgba(255,255,255,0.1)"/><stop offset="100%" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><circle cx="50" cy="50" r="50" fill="url(%23g)"/></svg>') repeat;
        opacity: 0.1;
        pointer-events: none;
        z-index: -1;
    }
}