/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

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

h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 40px;
    font-size: 1.1em;
}

/* Seção 1: Seleção de Cores */
.selection-section {
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.selection-section h2 {
    color: #34495e;
    margin-bottom: 20px;
    text-align: center;
}

.color-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.color-btn {
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.color-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.color-btn:active {
    transform: translateY(0);
}

.base-color-input {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.base-color-input label {
    font-weight: 600;
    color: #2c3e50;
}

#base-color {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    width: 120px;
    text-align: center;
    transition: border-color 0.3s ease;
}

#base-color:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.update-palette-btn {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.update-palette-btn:hover {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Seção 2: Paleta */
.palette-section {
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.palette-section h2 {
    color: #34495e;
    margin-bottom: 25px;
    text-align: center;
}

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

.palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease;
}

.palette-item:hover {
    transform: translateY(-3px);
}

.color-box {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

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

.color-label {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.8em;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 70px;
}

.base-color {
    border: 2px solid #2c3e50;
}

/* Container para aplicações lado a lado */
.applications-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* Aplicação Prática */
.application-section {
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #3498db;
    display: flex;
    flex-direction: column;
}

.light-section {
    background: #f8f9fa;
}

.dark-section {
    background: #1f2937;
}

.dark-section h3,
.dark-section label,
.dark-section .section-subtitle,
.dark-section .hex-value {
    color: #f8f9fa;
}

.application-section h3 {
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3em;
}

.light-section h3 {
    color: #34495e;
}

.dark-section h3 {
    color: #f8f9fa;
}

.section-subtitle {
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.dark-section .section-subtitle {
    color: #d1d5db;
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    flex: 1;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    font-size: 0.9em;
    min-width: 80px;
}

.light-section label {
    color: #2c3e50;
}

.dark-section label {
    color: #f8f9fa;
}

.percent-input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    width: 70px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.percent-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.hex-value {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background: #e9ecef;
    padding: 6px 10px;
    border-radius: 4px;
    flex: 1;
    text-align: center;
}

.dark-section .hex-value {
    background: #374151;
    color: #f8f9fa;
}

.update-btn {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.update-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.preview-box {
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-width: 2px;
    border-style: solid;
}

.preview-text {
    font-size: 1.0em;
    font-weight: 600;
    margin: 0;
    transition: color 0.3s ease;
}

/* Seção 3: Explicações */
.info-section {
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-section h2 {
    color: #34495e;
    margin-bottom: 25px;
    text-align: center;
}

.explanations {
    display: grid;
    gap: 25px;
}

.explanation-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #e74c3c;
}

.explanation-item h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.explanation-item p {
    margin-bottom: 10px;
}

.explanation-item ul, .explanation-item ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.explanation-item li {
    margin-bottom: 5px;
}

code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e74c3c;
}

/* Responsividade */
@media (max-width: 768px) {
    .color-buttons {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .color-box {
        width: 60px;
        height: 60px;
    }
    
    .color-label {
        font-size: 0.7em;
        min-width: 60px;
    }
    
    .base-color-input {
        flex-direction: column;
        gap: 10px;
    }
    
    .applications-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .control-group label {
        min-width: auto;
        text-align: center;
    }
    
    .preview-box {
        padding: 30px;
        min-height: 120px;
    }
    
    .preview-text {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .color-box {
        width: 50px;
        height: 50px;
    }
    
    .color-label {
        font-size: 0.6em;
        min-width: 50px;
    }
    
    body {
        padding: 10px;
    }
    
    .application-section {
        padding: 15px;
    }
    
    .preview-box {
        padding: 20px;
        min-height: 100px;
    }
    
    .preview-text {
        font-size: 1.1em;
    }
    
    .percent-input {
        width: 100%;
    }
}