/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    transition: all 0.4s ease;
    padding: 20px;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

body.dark-mode .container {
    background: #2d2d2d;
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
}

/* Container Styles */
.container {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2.5rem;
    font-weight: 700;
}

body.dark-mode h1 {
    color: #ffffff;
}

p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

body.dark-mode p {
    color: #cccccc;
}

/* Button Group */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

/* Button Styles */
.btn {
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px);
}

/* Primary Button (Cycle Colors) */
.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primary-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Random Button */
.random-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.random-btn:hover {
    background: linear-gradient(135deg, #ee82f0 0%, #f24458 100%);
}

/* Reset Button */
.reset-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #3d8bfe 0%, #00d4ff 100%);
}

/* Dark Mode Toggle Button */
.dark-btn {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.dark-btn:hover {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
}

/* Info Section */
.info-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
}

body.dark-mode .info-section {
    background: #3a3a3a;
    border-left-color: #f093fb;
}

.color-info, .click-counter {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.color-info span, .click-counter span {
    font-weight: bold;
    color: #667eea;
}

body.dark-mode .color-info span, 
body.dark-mode .click-counter span {
    color: #f093fb;
}

/* Color Palette Section */
.color-palette {
    margin-bottom: 25px;
}

.color-palette h3 {
    color: #333;
    margin-bottom: 15px;
}

body.dark-mode .color-palette h3 {
    color: #ffffff;
}

.color-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 40px;
    align-items: center;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.2);
}

/* Footer */
footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    color: #666;
}

body.dark-mode footer {
    border-top-color: #555;
    color: #cccccc;
}

footer strong {
    color: #667eea;
}

body.dark-mode footer strong {
    color: #f093fb;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 25px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Animation for background changes */
@keyframes colorChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.color-changing {
    animation: colorChange 0.3s ease;
}