/* ===========================
   AnimateX - Show off motion!
   style.css (upgraded)
=========================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Inter,Segoe UI,Arial,sans-serif;
}

body{
    background:radial-gradient(circle at top, #1e293b, #0b0f1f 70%);
    color:#fff;
    overflow:hidden;
}

/* Slow rotating neon glow behind everything */
body::before{
    content:"";
    position:fixed;
    inset:-25%;
    background:conic-gradient(from 0deg at 50% 35%,
        rgba(74,222,128,0.12),
        rgba(59,130,246,0.12),
        rgba(168,85,247,0.12),
        rgba(244,114,182,0.12),
        rgba(251,146,60,0.12),
        rgba(74,222,128,0.12));
    filter:blur(90px);
    animation:bgSpin 22s linear infinite;
    pointer-events:none;
    z-index:0;
}

@keyframes bgSpin{
    to{ transform:rotate(360deg); }
}

/* App */
.app{
    display:flex;
    flex-direction:column;
    height:100vh;
    position:relative;
    z-index:1;
}

/* Header */
header{
    height:65px;
    background:rgba(30,41,59,0.85);
    backdrop-filter:blur(6px);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 25px;
    border-bottom:1px solid rgba(55,65,81,0.8);
}

header h1{
    font-size:30px;
    color:#4ade80;
    animation:titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow{
    0%,100%{ text-shadow:0 0 14px rgba(74,222,128,0.6), 0 0 30px rgba(74,222,128,0.25); }
    50%{ text-shadow:0 0 22px rgba(74,222,128,0.95), 0 0 55px rgba(74,222,128,0.45); }
}

.header-buttons{
    display:flex;
    gap:10px;
}

/* Buttons */
button{
    border:none;
    background:linear-gradient(180deg,#3b4759,#2a3344);
    color:#fff;
    padding:10px 18px;
    border-radius:10px;
    cursor:pointer;
    transition:.2s;
    font-size:15px;
    box-shadow:0 3px 8px rgba(0,0,0,0.3);
}

button:hover{
    background:linear-gradient(180deg,#4d5a6e,#38434f);
    transform:translateY(-2px);
    box-shadow:0 6px 14px rgba(0,0,0,0.35);
}

button:active{
    transform:scale(.97);
}

.tool.active{
    background:linear-gradient(180deg,#22c55e,#16a34a);
    box-shadow:0 0 18px rgba(34,197,94,0.6);
}

/* Toolbar */
.toolbar{
    height:70px;
    background:rgba(30,41,59,0.85);
    backdrop-filter:blur(6px);
    border-bottom:1px solid rgba(55,65,81,0.8);
    display:flex;
    align-items:center;
    gap:20px;
    padding:0 20px;
}

.toolbar label{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:15px;
}

input[type=color]{
    width:42px;
    height:42px;
    border:none;
    background:none;
    cursor:pointer;
    filter:drop-shadow(0 0 5px rgba(255,255,255,0.3));
}

input[type=range]{
    width:140px;
    accent-color:#22c55e;
    filter:drop-shadow(0 0 5px rgba(34,197,94,0.5));
}

/* Main */
main{
    flex:1;
    display:flex;
    justify-content:center;
    align-items:center;
    background:rgba(15,23,42,0.4);
}

/* Canvas */
.canvas-container{
    background:#1f2937;
    padding:25px;
    border-radius:18px;
    box-shadow:
        0 15px 35px rgba(0,0,0,.45),
        0 0 0 1px rgba(255,255,255,0.05),
        0 0 45px rgba(34,197,94,0.10);
}

canvas{
    background:#fff;
    border-radius:10px;
    cursor:crosshair;
    border:3px solid #4b5563;
    image-rendering:pixelated;
}

/* Controls */
.controls{
    background:rgba(30,41,59,0.85);
    backdrop-filter:blur(6px);
    border-top:1px solid rgba(55,65,81,0.8);
    display:flex;
    justify-content:center;
    gap:15px;
    padding:15px;
}

/* Timeline */
.timeline{
    background:rgba(15,23,42,0.85);
    height:130px;
    overflow-x:auto;
    overflow-y:hidden;
    border-top:1px solid rgba(55,65,81,0.8);
    padding:15px;
}

#frameStrip{
    display:flex;
    gap:14px;
}

/* Frame */
.frame{
    width:90px;
    height:90px;
    background:#374151;
    border-radius:12px;
    border:3px solid transparent;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:.2s;
    flex-shrink:0;
    font-size:22px;
    box-shadow:0 3px 8px rgba(0,0,0,0.3);
}

.frame:hover{
    transform:scale(1.05);
    box-shadow:0 0 16px rgba(255,255,255,0.18);
}

.frame.selected{
    border-color:#22c55e;
    background:#4b5563;
    box-shadow:0 0 18px rgba(34,197,94,0.5);
}

/* Footer */
footer{
    height:38px;
    background:rgba(30,41,59,0.85);
    backdrop-filter:blur(6px);
    border-top:1px solid rgba(55,65,81,0.8);
    display:flex;
    justify-content:center;
    align-items:center;
    color:#d1d5db;
    font-size:14px;
}

/* Scrollbar */
::-webkit-scrollbar{
    height:10px;
}

::-webkit-scrollbar-track{
    background:#111827;
}

::-webkit-scrollbar-thumb{
    background:#4b5563;
    border-radius:8px;
}

::-webkit-scrollbar-thumb:hover{
    background:#6b7280;
}

/* Responsive */
@media(max-width:900px){
    .toolbar{
        flex-wrap:wrap;
        height:auto;
        padding:12px;
    }
    canvas{
        width:95vw;
        height:auto;
    }
    .controls{
        flex-wrap:wrap;
    }
}

.frame img{
    width:80px;
    height:70px;
    object-fit:contain;
    background:#fff;
    border-radius:8px;
}

.frame{
    padding:5px;
}

.animation-btn{
    font-weight:bold;
    letter-spacing:1px;
    padding:12px 25px;
    border-radius:14px;
    transition:.25s;
    font-size:16px;
}

.play-btn{
    background:linear-gradient(180deg,#22c55e,#16a34a);
    color:#fff;
    box-shadow:0 0 20px rgba(34,197,94,0.5);
}

.pause-btn{
    background:linear-gradient(180deg,#ef4444,#dc2626);
    color:#fff;
    box-shadow:0 0 20px rgba(239,68,68,0.5);
}

.play-btn:hover{
    background:linear-gradient(180deg,#16a34a,#15803d);
    transform:scale(1.08);
    box-shadow:0 0 30px rgba(34,197,94,0.8);
}

.pause-btn:hover{
    background:linear-gradient(180deg,#dc2626,#b91c1c);
    transform:scale(1.08);
    box-shadow:0 0 30px rgba(239,68,68,0.8);
}

#playAnimation,
#pauseAnimation{
    width:300px;
    align-self:center;
}
