@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans&display=swap');

body {
    background-color: #22c1e9;
    color: rgb(0, 0, 0);
    font-family: 'Pixelify Sans', cursive;
    margin: 0;
    padding: 0;
}

button {
    background-color: #363537;
    font-family: 'Pixelify Sans', cursive;
    color: white;
    border: none;
    padding: 10px 10px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: #000000 0px 3px 5px;
}

button.active {
  background-color: #8cd867;
  background-color: #2fbf71;
}

button:hover {
    background-color: #2fbf71;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 #2fbf71;
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(47,191,113,0.3);
        transform: scale(1.07);
    }
    100% {
        box-shadow: 0 0 0 0 #2fbf71;
        transform: scale(1);
    }
}

button.pulse {
    animation: pulse 0.4s;
}

nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    background: linear-gradient(90deg, #ed7d3a 0%, #ffd447 100%);
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 5px solid #8cd867;
}

.export{
    background-color: #9e1e3a;
    
    
    
}
.export:hover {
    background-color: #ef2d56;
}
.title {
    font-size: 32px;
    font-weight: bold;
    color: #000000;
    margin-right: auto;
}

.canvas-bg{
    background-color: transparent;
    background-image: url("./assets/canvas.png");
    background-size: contain;     
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    max-width: 900px;                
    min-height: 200px;
    max-height: 900px;               
    width: 100vw;
    height: 100vh;
}
.canvas-container {
    background-color: transparent;
    background-image: url("./assets/background.png");
    background-size: cover;     
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    flex-direction: row;
    gap: 290px;
    align-items: center;
    justify-content: center;
    width: 700px;
    height: auto;
    padding: 46px;
}
.canvas-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    
    width: auto;
    box-sizing: border-box;
}

@media (max-width: 1300px) {
    .canvas-controls {
    flex-wrap: wrap;
    justify-content: center;
    width: 100vw;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
  }
  
}

.canvasstyle {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    
    background-color: #ffffff00;
    border: 5px solid #000000;
}
#canvas {
    background-color: #f0f0f0; 
    
    pointer-events: auto;
    z-index: 3;
}

.toolbar {
    background: linear-gradient(90deg, #ed7d3a 0%, #ffd447 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    gap: 10px;
    border: 5px solid #000000;
    image-rendering: pixelated;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #8cd867, 0 5px 10px 6px #3b3b3b;
    width: 160px;
    max-height: 340px;
    padding: 10px;
    
}


.toolbar font {
    text-shadow: 1px 1px 2px #fff, 0 0 4px #2fbf71;
    
}

.selector{
    width: 30px;
}

.tool-pencil{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.editor {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    
    
}

.frame-canvas {
    
    width: auto;
    height: auto;
    max-width: 100px;
    max-height: 100px;
    border-radius: 10px;
    border: 2px solid #000000;
    background-color: #ffffff;
    display: block;
    margin: 0 auto;
    cursor: pointer;
}
.animation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 20px;
    border: 5px solid #000000;
    background-image: url("./assets/grass.png");
    background-size: auto;
    background-repeat: repeat;
}

.animation
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    
}

.animation-controls{
   margin: 10px;
   background: linear-gradient(90deg, #ed7d3a 0%, #ffd447 100%);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 5px solid #000000;
    border-radius: 20px;
    image-rendering: pixelated;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #8cd867;
    width: 520px;
    height: 70px; 
}

.frame-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 105px;
    height: 105px;
    border-radius: 10px;
    position: relative;
}

.frame-wrap.active {
    border: 2px solid #2fbf71;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #8cd867;
}

.timeline {
    background: linear-gradient(180deg, #ed7d3a 0%, #ffd447 100%);
    display: grid;
    grid-template-columns: repeat(auto-fill, 128px);
    grid-auto-rows: 128px;
    gap: 5px;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 5px solid #000000;
    image-rendering: pixelated;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #8cd867;
    width: calc(100% - 20px);
    max-width: 98vw;           
}

.timeline-container{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px;
}

.frame-number {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 14px;
    font-family: 'Pixelify Sans', cursive;
    color: #222;
    background: rgba(198, 197, 197, 0.7);
    padding: 0 4px;
    border-radius: 3px;
    z-index: 2;
    pointer-events: none;
}
.frame-wrap.active {
    width: 105px;
    border: 2px solid #2fbf71;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #8cd867;
}

.frame-wrap:hover .delete-frame {
  display: inline-block;
}


.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, 20px); 
    grid-auto-rows: 20px; 
    gap: 6px;
    background-color: #ffffff;
    border: 5px solid #000000;
    border-radius: 20px;
    image-rendering: pixelated;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #8cd867;
    width: 154px;
    min-width: none;
    min-height: 25px;
    height: auto;
    max-height: 340px;      
    padding: 10px;
    overflow-y: auto;
    overflow: hidden;
    justify-content: start;
}

.color{
    width: 20px;
    height: 20px;
    border: 2px solid #363537;
    
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    line-height: normal;
}
.color:hover {
    border: 2px solid #2fbf71;
    cursor: pointer;
}

.color-picker-wrap {
    width: 113px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

div.pulse {
    animation: pulse 0.4s;
}

.alert {
    color: red;
    text-shadow: 1px 1px 1px #222;
    font-weight: bold;
    font-size: 14px;
    margin-left: 10px;
}

.undo-redo {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.icons{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
}


.selector {
  width: 48px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.25);
  box-shadow: 0 2px 8px rgba(47,191,113,0.10), 0 0 0 2px #8cd867;
  color: #eae9e9;
  text-shadow: 1px 1px 1px #222;
  font-size: 18px;
  font-family: 'Pixelify Sans', cursive;
  text-align: center;
  outline: none;
  transition: box-shadow 0.2s, background 0.2s;
  backdrop-filter: blur(2px);
}

.selector:focus {
  background: rgba(255,255,255,0.45);
  box-shadow: 0 0 0 3px #2fbf71, 0 2px 8px rgba(47,191,113,0.15);
  color: #ffffff;
}

.delete-icon {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-image: url("./assets/delete-svgrepo-com.svg");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    border: none;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    cursor: pointer;
    background-color: transparent;
}

.delete-icon {
    transition: filter 0.15s, transform 0.15s;
}

.delete-icon:hover {
    filter: brightness(1.2) drop-shadow(0 0 6px #ef2d56);
    transform: scale(1.15) rotate(-10deg);
}

.delete-frame {
    all: unset;
    display: none;
    width: 30px;
    height: 30px;
    background-image: url("./assets/delete-svgrepo-com.svg");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    border: none;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    cursor: pointer;
    background-color: transparent;
}

.delete-frame:hover {
all: unset;
}

#sky {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
    z-index: -1;
    overflow: hidden;       
}

.cloud {
  position: absolute;
  top: 0;
  width: 100px;
  animation: moveCloud linear infinite;
  filter: drop-shadow(6px 8px 5px rgba(0, 0, 0, 0.35));
  z-index: -6666;
  opacity: 0.8;
}




@keyframes moveCloud {
  0% {
    transform: translateX(100vw);
  }
  100% {
    transform: translateX(-200px);
  }
}



@media screen and (max-width: 1300px) {
    .toolbar {
        width: calc(100% - 50px);
        
        flex-direction: row;
        overflow-x: visible;
        overflow-y: visible;
        overflow: visible;
        padding: 5px;
        gap: 5px;
        
    }

    .toolbar font, .toolbar-title {
        font-size: 1.5rem;
        margin-bottom: 0;
        text-shadow: 1px 1px 2px #fff, 0 0 4px #2fbf71;
    }
    .tool-pencil, .color-picker-wrap {
        flex-direction: column;
        gap: 20px;
    }
    
   

    .color-picker-wrap {
        width: 90px;
        height: 90px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        
    }
    .color-palette {
        width: auto;
        min-width: 25px;
        max-width: 600px;
        min-height: 25px;
        padding: 10px;
        overflow-x: visible;
        overflow-y: visible;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(20px, 1fr));
        grid-auto-rows: 20px;
        justify-content: start;
    }
    .canvas-bg {
        
        width: 0;
        max-height: 700px;
        
        background-image: none;
        background-size: cover;
        background-repeat: no-repeat;
    }
    
    

    .editor {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        
    }
    .canvas-controls {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        padding: 10px;
    }
    
}

@media screen and (max-width: 800px) {
    .canvas-container {
    
    background-image: none;
    width: 0;
    height: 0;
    
    }

    .canvas-bg{
        width: calc(100% - 50px);
        
    }

    .toolbar {
    background: linear-gradient(90deg, #ed7d3a 0%, #ffd447 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    gap: 10px;
    border: 5px solid #000000;
    image-rendering: pixelated;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #8cd867, 0 5px 10px 6px #3b3b3b;
    width: 300px;
    max-height: 600px;
    padding: 10px;
    
}
    .toolbar font {
    text-shadow: 1px 1px 2px #fff, 0 0 4px #2fbf71;
    
}
    .tool-pencil {
        flex-direction: row;
        gap: 20px;
    }

    

.editor {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        
    }
}