:root {
    --blanco: #f8f9fa;
    --verde: #28a745;
    --amarillo: #ffc107;
    --azul: #007bff;
    --gris: #e9ecef;
    --gris-oscuro: #343a40;
    --exito: #28a745;
    --error: #dc3545;
    --primary: #6a11cb;
    --secondary: #2575fc;
}

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

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

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

header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tabs {
    display: flex;
    justify-content: center;
    margin: 20px 0 30px;
    position: relative;
}

.tab {
    padding: 14px 30px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 30px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 10px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.tab:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-3px);
}

.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

h2 {
    color: #2c3e50;
    border-bottom: 3px solid var(--secondary);
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}

h2 i {
    margin-right: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.input-group {
    margin-bottom: 22px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 1.1rem;
}

input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s;
}

input:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 117, 252, 0.2);
}

.color-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 25px 0;
}

.color-btn {
    padding: 20px;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.color-btn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
    opacity: 0;
    transition: opacity 0.3s;
}

.color-btn:hover::before {
    opacity: 1;
}

.color-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

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

.color-btn.selected {
    box-shadow: 0 0 0 4px white, 0 0 0 8px var(--secondary);
    transform: translateY(-3px);
}

#blancoBtn, #blancoBtnExit {
    background: linear-gradient(135deg, #ffffff, #f1f3f5);
    color: #212529;
    border: 1px solid #ced4da;
}

#verdeBtn, #verdeBtnExit {
    background: linear-gradient(135deg, #2b8a3e, #51cf66);
}

#amarilloBtn, #amarilloBtnExit {
    background: linear-gradient(135deg, #e67700, #ffd43b);
    color: #212529;
}

#azulBtn, #azulBtnExit {
    background: linear-gradient(135deg, #1864ab, #4dabf7);
}

.action-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
    opacity: 0;
    transition: opacity 0.3s;
}

.action-btn:hover::before {
    opacity: 1;
}

.action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.25);
}

#salidaBtn {
    background: linear-gradient(to right, #e03131, #ff6b6b);
}

.controls {
    display: flex;
    gap: 18px;
    margin-top: 30px;
}

.control-btn {
    flex: 1;
    padding: 18px;
    background: linear-gradient(to right, #2b8a3e, #51cf66);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
    opacity: 0;
    transition: opacity 0.3s;
}

.control-btn:hover::before {
    opacity: 1;
}

.control-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

#loadBtn {
    background: linear-gradient(to right, #0c8599, #22b8cf);
}

.message {
    margin-top: 25px;
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    font-size: 1.1rem;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s ease;
}

.message.show {
    opacity: 1;
    transform: translateY(0);
}

.success {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--exito);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.error {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--error);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 15px 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
    font-size: 1.1rem;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 25px;
    color: #6c757d;
    font-size: 1rem;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .color-buttons {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
    }
    
    h1 {
        font-size: 2.2rem;
    }
}