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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 42rem;
}

/* Control Panel Styles */
.control-panel {
    background: white;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

/* Color Picker */
.color-input {
    width: 3rem;
    height: auto;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    cursor: pointer;
    flex-shrink: 0;
}

.color-input:hover {
    border-color: #d1d5db;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    flex: 1;
    min-width: 0;
}

.dropdown-btn {
    width: 100%;
    height: 100%;
    padding: 0.625rem 1rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 1rem;
    color: #374151;
    transition: border-color 0.2s;
}

.dropdown-btn:hover {
    border-color: #9ca3af;
}

.dropdown-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: none;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-item {
    width: 100%;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f9fafb;
}

.checkmark {
    width: 1.25rem;
    height: 1.25rem;
    color: #2563eb;
    display: none;
}

.dropdown-item.active .checkmark {
    display: block;
}

/* Generate Button */
.generate-btn {
    padding: 0.625rem 1.5rem;
    background: #f3f4f6;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.generate-btn:hover {
    background: #e5e7eb;
}

/* Colors Container */
.colors-container {
    background: white;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
}

/* Color Card (swatch + hex value together) */
.color-card {
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
}

.color-swatch {
    height: 20rem;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.05);
    z-index: 1;
}

.color-swatch .copy-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.color-swatch:hover .copy-icon {
    opacity: 1;
}

/* Hex Value */
.hex-value {
    padding: 1rem 0.5rem;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    position: relative;
    border: none;
    background: white;
    border-top: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.hex-value:hover {
    background: #f9fafb;
}

.hex-value .copied-message {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.75rem;
    color: #10b981;
    opacity: 0;
    pointer-events: none;
}

.hex-value .copied-message.show {
    opacity: 1;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .control-panel {
        padding: 1rem;
    }

    /* Stack colors vertically on mobile */
    .colors-container {
        flex-direction: column;
    }

    .color-card {
        width: 100%;
        flex: none;
    }

    .color-swatch {
        height: 8rem;
    }

    .hex-value {
        font-size: 1rem;
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .control-panel {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .color-input {
        width: 2.5rem;
    }

    .dropdown {
        order: 3;
        flex-basis: 100%;
        margin-top: 0.25rem;
    }

    .generate-btn {
        flex: 1;
    }

    .color-swatch {
        height: 6rem;
    }

    .hex-value {
        font-size: 0.875rem;
        padding: 1rem;
    }
}