/* ==========================================
   CSS RESET E CONFIGURAÇÕES BÁSICAS
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --background-light: #f8fafc;
    --background-card: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-radius: 12px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
}

/* ==========================================
   TIPOGRAFIA E ESTILOS GLOBAIS
   ========================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-light); /* Cor de fundo clara */
    min-height: 100vh;
    color: var(--text-dark);
}

/* ==========================================
   LAYOUT PRINCIPAL
   ========================================== */
.container {
    max-width: 1300px;
    margin: 0 auto;
    background: #f1f3f5; /* Cor ligeiramente mais escura que o body */
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Box-shadow mais leve */
    padding: var(--spacing-sm);
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.header {
    text-align: center;
    margin-bottom: var(--spacing-xs);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--spacing-xs);
    align-items: start;
}

/* ==========================================
   TÍTULOS E TEXTOS
   ========================================== */
.main-title {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.section-title {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

/* ==========================================
   SEÇÃO DO SELETOR DE CORES
   ========================================== */
.color-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.color-picker-container {
    background: var(--background-light);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-light);
}

.color-input-wrapper {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.color-label-main {
    display: block;
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

/* ==========================================
   INPUT DE COR PERSONALIZADO
   ========================================== */
#colorPicker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 80px;
    height: 80px;
    background-color: transparent;
    border: 3px solid var(--border-color);
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    transition: all 0.2s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#colorPicker:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

#colorPicker::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
}

#colorPicker::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

#colorPicker::-moz-color-swatch-wrapper {
    padding: 0;
    border: none;
}

#colorPicker::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

/* ==========================================
   DISPLAY DA COR SELECIONADA
   ========================================== */
#selectedColorDisplay {
    height: 150px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    margin: 0 auto;
}

/* ==========================================
   GRID DOS CÓDIGOS DE COR
   ========================================== */
.color-codes-grid {
    display: grid;
    gap: var(--spacing-sm);
}

.color-code-item {
    background: var(--background-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.2s ease;
}

.color-code-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-light);
}

.color-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    min-width: 50px;
}

.color-value {
    flex: 1;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    background: var(--background-light);
    border: none;
    padding: var(--spacing-xs);
    border-radius: 6px;
    color: var(--text-dark);
    font-weight: 500;
    text-align: center;
    font-size: 0.9rem;
}

.copy-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    min-width: 80px;
}

.copy-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: scale(0.98);
}

/* ==========================================
   MENSAGEM DE CÓPIA
   ========================================== */
.copy-message {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
    font-weight: 500;
    box-shadow: var(--shadow-light);
    text-align: center;
    margin-top: var(--spacing-sm);
}

.hidden {
    display: none;
}

/* ==========================================
   SEÇÃO DE INSTRUÇÕES
   ========================================== */
.instructions-section {
    background: var(--background-light);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    border-left: 4px solid var(--primary-color);
}

.step-item {
    background: var(--background-card);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--shadow-light);
    border-left: 4px solid var(--accent-color);
}

.step-content {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-info {
    flex: 1;
}

.step-info strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
    font-size: 1rem;
}

.step-description {
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* ==========================================
   CARD DE DICA E DESCRIÇÃO
   ========================================== */
.tip-card {
    background: var(--background-card);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    box-shadow: var(--shadow-light);
    border: 2px solid var(--accent-color);
}

.tip-title {
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    font-size: 1.1rem;
}

.tip-text {
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

.description-text {
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.feature-list {
    background: var(--background-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.feature-item {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--background-card);
    font-size: 0.9rem;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item strong {
    color: var(--primary-color);
}

/* ==========================================
   RESPONSIVIDADE - TABLETS
   ========================================== */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .container {
        margin: var(--spacing-xs);
        padding: var(--spacing-md);
        border-radius: var(--border-radius);
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .color-picker-container {
        padding: var(--spacing-md);
    }
    
    #colorPicker {
        width: 70px;
        height: 70px;
    }
    
    #selectedColorDisplay {
        height: 120px;
    }
    
    .color-code-item {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
    
    .color-value {
        width: 100%;
        max-width: 280px;
    }
    
    .copy-btn {
        width: 100%;
        max-width: 120px;
    }
    
    .instructions-section {
        border-left: none;
        border-top: 4px solid var(--primary-color);
    }
}

/* ==========================================
   RESPONSIVIDADE - MOBILE
   ========================================== */
@media (max-width: 480px) {
    body {
        padding: var(--spacing-xs);
    }
    
    .container {
        margin: 0;
        padding: var(--spacing-sm);
    }
    
    .main-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .color-picker-container {
        padding: var(--spacing-sm);
    }
    
    #colorPicker {
        width: 60px;
        height: 60px;
    }
    
    #selectedColorDisplay {
        height: 100px;
    }
    
    .color-code-item {
        padding: var(--spacing-xs);
    }
    
    .color-value {
        font-size: 0.85rem;
        padding: var(--spacing-xs);
    }
    
    .copy-btn {
        padding: var(--spacing-xs);
        font-size: 0.8rem;
    }
    
    .step-item {
        padding: var(--spacing-sm);
    }
    
    .step-number {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.8rem;
    }
    
    .feature-item {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.85rem;
    }
    
    .tip-card {
        padding: var(--spacing-sm);
    }
    
    .copy-message {
        font-size: 0.9rem;
        padding: var(--spacing-xs);
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ==========================================
   ANIMAÇÕES E TRANSIÇÕES
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.copy-message:not(.hidden) {
    animation: fadeIn 0.3s ease;
}

/* ==========================================
   MELHORIAS DE ACESSIBILIDADE
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.color-code-item:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-light);
}
