/* style.css */

:root {
    --bg-color: rgb(26,29,55);
    --dock-bg: rgba(30, 41, 59, 0.7);
    --accent: #38bdf8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --u-r-btn: rgb(161, 252, 100);
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevents scrolling while drawing */
    background-color: var(--bg-color);
    font-family: 'Inter', system-ui, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

#canvas {
    height: 100vh;
    width: 100vw;
    background: var(--bg-color);
    cursor: crosshair;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    display: block;
    touch-action: none;
}

#container {
    width: auto;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 12px 25px;
    background: var(--dock-bg);
    backdrop-filter: blur(12px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 100px; /* Pill shape */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 10;
    transition: all 0.3s ease;
}

#container:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 20px 50px rgba(56, 189, 248, 0.15);
}
#clear-btn {
    padding: 0.7rem 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    border: 2px solid #ff4d4d;
    color: #ff4d4d;
    background: #1e1e1e;
    cursor: pointer;
    transition: all 0.25s ease;
}

#clear-btn:hover {
    background: #ff4d4d;
    color: #fff;
    box-shadow: 0 0 18px #ff4d4d;
}

#clear-btn:active {
    transform: scale(0.95);
}
#colorpick {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 42px;
    height: 42px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#colorpick:hover {
    transform: scale(1.15) rotate(-10deg);
}

#colorpick::-webkit-color-swatch {
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#size {
    -webkit-appearance: none;
    width: 140px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
}

#size::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
    border: 2px solid var(--accent);
    transition: all 0.2s ease;
}

#size::-webkit-slider-thumb:hover {
    background: var(--accent);
    transform: scale(1.2);
}
#size-value::-webkit-outer-spin-button,
#size-value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#size-value {
    -moz-appearance: textfield;
}
@keyframes neonPulse {
    0% {
        box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
    }
    50% {
        box-shadow: 0 0 14px var(--accent), 0 0 28px var(--accent);
    }
    100% {
        box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
    }
}

#mode-container{
    position: absolute;
    top: 1rem;
    width: 12vw;
    height: 5vh;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    background-color: var(--bg-color); /* dark base for neon contrast */
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 0 20px var(--accent), 0 0 20px var(--accent);
    z-index: 1000;
    gap: 0.5rem;

    opacity: 1;
    transition: opacity 0.5s ease;
    animation: neonPulse 2s infinite ease;
    span{
        width: 4rem;
    }
}
#mode-container.hidden{
    opacity: 0;
}

#size-value {
    width: 50px;
    padding: 5px 8px;
    font-size: 1rem;
    color: white;
    background: rgba(17,17,17,0.85); /* dark glass */
    border: 2px solid var(--accent);
    border-radius: 10px;
    text-align: center;
    outline: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: neonPulse 2s infinite ease-in-out;
}

/* Hover effect for stronger glow */
#size-value:hover {
    transform: scale(1.05);
    box-shadow: 0 0 18px var(--accent), 0 0 36px var(--accent);
}

/* Focus effect */
#size-value:focus {
    box-shadow: 0 0 28px var(--accent), 0 0 56px var(--accent);
    background: rgba(17,17,17,0.9);
}

#container::before {
    content: 'Brush Settings';
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

/* ===== Neon Zoom Toggle ===== */

.zoom-toggle {
    position: relative;
    display: flex;
    width: 180px;
    height: 38px;
    background: rgba(0,0,0,0.85);
    border-radius: 50px;
    overflow: hidden;
    border: 2px solid var(--accent);
    transition: all 0.2s ease;
}
.zoom-toggle:hover{
    box-shadow: 0 0 15px var(--accent);
}

.zoom-option {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 2;
    transition: 0.3s;
}

.zoom-option:hover {
    text-shadow: 0 0 8px var(--accent);
}

.zoom-option.active {
    color: black;
}

.zoom-slider {
    position: absolute;
    width: 50%;
    height: 100%;
    background: var(--accent);
    border-radius: 50px;
    transition: transform 0.3s ease;
    z-index: 1;
    box-shadow:
        0 0 10px var(--accent),
        0 0 20px var(--accent);
}

#undo-container{
    position: fixed;
    left: 90%;
    height: auto;
    bottom: 25px;
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 20px;
    background-color: var(--dock-bg);
    border: 1px solid;
    transition: all 0.3s ease;
}
#undo-container:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 20px 50px rgba(56, 189, 248, 0.15);
}
.undo-btn{
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(6px);
    font-size: larger;
    color: var(--u-r-btn);
    -webkit-backdrop-filter: blur(6px);
    border: 2px solid var(--u-r-btn);
    border-radius: 10px;
    padding: 0.2rem 0.6rem;
    font-weight: 600;
    width: auto;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}
.undo-btn:hover{
    background-color: var(--u-r-btn);;
    border-color: var(--u-r-btn);;
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 2px 18px rgb(136, 255, 245);
}

/* Add this to your main CSS or replace the bottom section */

@media only screen and (max-width: 768px) {
    #container {
        width: 90%;
        bottom: 1rem;
        gap: 1rem;
        padding: 10px 15px;
        flex-wrap: wrap; /* Allows items to stack if the screen is very narrow */
        justify-content: center;
        border-radius: 25px;
    }

    #container::before {
        display: none;
    }

    #colorpick, #colorpick1 {
        width: 2rem;
        height: 2rem;
    }

    #size {
        width: 100px;
    }

    #undo-container {
        left: auto;
        right: 1rem;
        top: 1rem;
        bottom: auto;
        flex-direction: row;
        padding: 8px;
        gap: 1rem;
        border-radius: 15px;
    }

    .undo-btn {
        padding: 0.6rem 1rem;
        font-size: 1.1rem;
    }

    /* Adjust the Zoom Toggle for touch */
    .zoom-toggle {
        display: none;
    }
    
    .zoom-option {
        font-size: 0.7rem;
    }

    #clear-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Landscape Mode for phones */
@media only screen and (max-height: 500px) and (orientation: landscape) {
    #container {
        bottom: 10px;
        padding: 5px 15px;
    }
        #undo-container {
        left: auto;
        right: 1rem;
        top: 1rem;
        bottom: auto;
        flex-direction: row;
        padding: 8px;
        gap: 1rem;
        border-radius: 15px;
    }
    .zoom-toggle{
        display: none;
    }

    .undo-btn {
        padding: 0.6rem 1rem;
        font-size: 1.1rem;
    }
}