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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease;
    min-height: 100vh;
    background-color: white;
}

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

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

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #333;
}

header p {
    font-size: 1.1rem;
    color: #666;
}

.background-controls {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    text-align: center;
}

.background-controls h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3rem;
}

.control-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    transition: color 0.3s ease;
}

.radio-option:hover {
    color: #333;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #007bff;
    background-color: #007bff;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

.custom-color-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.05);
}

.custom-color-container input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.search-container {
    margin-bottom: 20px;
    text-align: center;
}

#searchInput {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 25px;
    width: 300px;
    max-width: 100%;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.example-section {
    margin-bottom: 40px;
    padding: 30px;
    border-radius: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.example-section h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.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.5s;
}

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

.primary {
    background-color: goldenrod;
    color: black;
    border-color: goldenrod;
}

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

.primary:disabled:hover,
.primary:disabled:active {
    transform: none;
    background-color: goldenrod;
    color: black;
}

.primary:hover {
    background-color: transparent;
    color: goldenrod;
    border-color: goldenrod;
}

.primary:active {
    background-color: goldenrod;
    color: black;
    transform: scale(0.98);
}

.secondary {
    background-color: transparent;
    color: goldenrod;
    border-color: goldenrod;
}

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

.secondary:disabled:hover,
.secondary:disabled:active {
    transform: none;
    background-color: transparent;
    color: goldenrod;
}

.secondary:hover {
    background-color: goldenrod;
    color: black;
}

.secondary:active {
    background-color: transparent;
    color: goldenrod;
    transform: scale(0.98);
}

.tertiary {
    background-color: transparent;
    color: grey;
    border-color: grey;
}

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

.tertiary:disabled:hover,
.tertiary:disabled:active {
    transform: none;
    color: grey;
    border-color: grey;
    background-color: transparent;
}

.tertiary:hover {
    border-color: goldenrod;
    color: goldenrod;
}

.tertiary:active {
    background-color: goldenrod;
    color: black;
    transform: scale(0.98);
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 20px;
}

.color-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 60px;
    position: relative;
    opacity: 1;
}

.color-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Crossed out state: whole container becomes very transparent */
.color-item.crossed-out {
    opacity: 0.5;
}

.color-button {
    width: 35px;
    height: 35px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.color-button:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-button:active {
    transform: scale(0.95);
}

.color-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

/* Normal state: bigger and bolder */
.color-name {
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
    cursor: default;
}

/* Crossed out state: smaller, not bold, with icon before */
.color-name.crossed-out {
    font-weight: 400;
    font-size: 12px;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: #ff4757;
    opacity: 0.5
}

.color-name.crossed-out::before {
    content: '❌ ';
    margin-right: 4px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #007bff;
}

.checkbox:hover {
    transform: scale(1.1);
}

/* Tooltip styles */
.tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    visibility: hidden;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Dark/Light theme adjustments for example section only */
.light-section {
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
}

.dark-section {
    background-color: rgba(0, 0, 0, 0.95);
    color: white;
}

.light-section h2 {
    color: #333;
}

.dark-section h2 {
    color: white;
}

#resetButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background-color: #ff4757;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

#resetButton:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 71, 87, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .colors-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 6px;
    }
    
    .color-item {
        padding: 6px;
        min-height: 50px;
    }
    
    .color-button {
        width: 30px;
        height: 30px;
        margin-right: 8px;
    }
    
    .color-name {
        font-size: 13px;
    }
    
    .color-name.crossed-out {
        font-size: 11px;
        opacity: 0.5;
    }
    
    .control-group {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    .tooltip {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .colors-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 4px;
    }
    
    .color-item {
        padding: 5px;
        min-height: 45px;
    }
    
    .color-button {
        width: 25px;
        height: 25px;
        margin-right: 6px;
    }
    
    .color-name {
        font-size: 12px;
    }
    
    .color-name.crossed-out {
        font-size: 10px;
        opacity: 0.5;
    }
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.color-item {
    animation: fadeIn 0.3s ease forwards;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
