/* ========================================================== */
/* ESTILOS BASE (Sin media query) */
/* ========================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MS Gothic', 'Osaka', 'Tahoma', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.toolbar {
    width: 100%;
    min-height: 80px;
    background: linear-gradient(135deg, rgba(68, 138, 82, 0.8) 0%, rgba(1, 68, 14, 0.7) 100%);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 10;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.toolbar h1 {
    color: white;  
    text-shadow: 0 0 10px rgba(178, 207, 171, 0.5);
    animation: glow 1.5s infinite alternate;
    font-size: 20px;
    text-transform: uppercase;
    font-weight: bold;
    margin: 0;
    white-space: nowrap;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #3ca023, 0 0 20px #3ca023; } 
    to { text-shadow: 0 0 20px #d5e0d3, 0 0 30px #3ca023; }
}


.tool-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.tool-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-button {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    touch-action: manipulation;
}



.tool-button.active {
    transform: scale(0.95);
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.2);
}

.brush-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    font-size: large;
}

.brush-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.eraser-btn {
    background: linear-gradient(135deg, #6c0000 0%, #a70000 100%);
    font-size: large;
}

.eraser-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(250, 112, 154, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, #f093fb 0%, #ae00ff 100%);
    font-size: large;
    padding: 8px 12px;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group label {
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.color-input {
    width: 40px;
    height: 40px;
    border: none;
    background-color: transparent;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    touch-action: manipulation;
}

.color-input:hover {
    transform: scale(1.05);
}

.range-input {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.size-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-value {
    background: linear-gradient(135deg, #bd88dd 0%, #ae00ff 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#drawing-board {
    width: 100vw;
    height: calc(100vh - 80px);
    background: white;
    cursor: crosshair;
    display: block;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.status-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-brush {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: medium;
}

.mode-eraser {
    background: linear-gradient(135deg, #6c0000 0%, #a70000 100%);
    color: white;
    font-size: medium;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.tool-button.active {
    animation: pulse 0.3s ease-out;
}

/* ========================================================== */
/* MEDIA QUERY max-width: 768px  */
/* ========================================================== */

@media (max-width: 768px) {
    .toolbar {
        min-height: 120px;
        padding: 15px 10px;
        gap: 15px;
        border-radius: 0;
    }

    .toolbar h1 {
        font-size: 18px;
    }

    .tool-group {
        gap: 10px;
    }

    .tool-button {
        padding: 10px 14px;
        font-size: 13px;
    }

    .input-group {
        gap: 8px;
    }

    .input-group label {
        font-size: 11px;
    }

    .clear-btn {
        max-width: fit-content;
    }

    .color-input {
        width: 45px;
        height: 45px;
    }

    .range-input {
        width: 100px;
        height: 8px;
    }

    .size-value {
        padding: 3px 8px;
        font-size: 11px;
    }

    #drawing-board {
        height: calc(100vh - 120px);
    }

    .status-indicator {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ========================================================== */
/* MEDIA QUERY max-width: 480px  */
/* ========================================================== */
@media (max-width: 480px) {
    .toolbar {
        min-height: 140px;
        padding: 10px 8px;
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar h1 {
        font-size: 16px;
        text-align: center;
        order: -1;
        width: 100%;
        margin-bottom: 5px;
    }

    .tool-group {
        justify-content: center;
        width: 100%;
        gap: 8px;
    }

    .tool-button {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
    }

    .input-group {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .input-group label {
        display: none;
    }

    .color-input {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }

    .range-input {
        width: 120px;
        height: 10px;
    }

    .range-input::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }

    .range-input::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }

    .size-value {
        padding: 4px 10px;
        font-size: 12px;
        border-radius: 8px;
    }

    #drawing-board {
        height: calc(100vh - 140px);
    }

    .status-indicator {
        top: 10px;
        right: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 12px;
        text-align: center;
    }
}
