* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    color: #333;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    width: 100%;
}

.brand_header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h1 {
    font-size: 2.5rem;
    color: #2c5f7d;
    margin-bottom: 5px;
}

h1 > span {
    color: #c0c0c0;
}

.logo {
    width: 60px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    color: #666;
}

/* Main Canvas Container - Takes all available space */
#canvasContainer {
    position: relative;
    flex: 1;
    /* width: 100%; */
    background: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

canvas {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 12px;
    /* max-width: 100%;
    max-height: 100%; */
}

/* Floating Drawing Tools Panel */
.drawing-tools {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
    opacity: .5;
}

.drawing-tools:hover {
    opacity:1;
}

.tool-button {
    width: fit-content;
    color: black;
    border: none;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 26px;
    text-align: center;
}

.tool-button:hover {
    background: #fb7474;
    color: white;
    transform: translateY(-2px);
}

.tool-button.active {
    background: #2c5f7d;
    color: white;
}

#drawTool.active {
    cursor: crosshair;
}

/* Timeline Container */
#timeline-container {
    width: 100%;
    background: white;
    padding: 15px;
    box-shadow: 0 -4px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Frame Tools Section */
.frame-tools {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Timeline Section */
#timeline {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #e9ecef;
    padding: 5px;
}

#timeline::-webkit-scrollbar {
    height: 8px;
}

#timeline::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
}

#timeline::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 10px;
}

/* Playback Controls */
.playback-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.playback-controls button {
    font-size: 22px;
}

#speed {
    transform: rotate(180deg);
}

/* Frame Thumbnails */
.frame-container {
    position: relative;
    display: inline-block;
    cursor: grab;
}

.frame-container.dragging {
    cursor: grabbing;
    opacity: 0.7;
}

.frame-thumbnail {
    width: 80px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.frame-thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.frame-thumbnail.active {
    border-color: #2c5f7d;
    box-shadow: 0 0 0 3px rgba(255,107,107,0.3);
}

.delete-frame {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #2c5f7d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.frame-container:hover .delete-frame {
    opacity: 1;
}

/* Form Controls */
button {
    background: #5a9bd4;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

button:hover {
    background: #339af0;
    transform: translateY(-2px);
}

.secondary-button {
    background: #e9ecef;
    color: #495057;
}

.secondary-button:hover {
    background: #dee2e6;
}

input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
}

input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    width: 100px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #5a9bd4;
    border-radius: 50%;
    cursor: pointer;
}

input[type="number"] {
    width: 70px;
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    text-align: center;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9ecef;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #5a9bd4;
}

input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.flex-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 10;
}

/* Utility Classes */
.separator {
    width: 1px;
    height: 30px;
    background: #dee2e6;
    margin: 0 5px;
}

/* Save/Load Container */
#saveLoadContainer {
    position: fixed;
    top: 25px;
    right: 20px;
    z-index: 100;
}

#saveLoadContainer button {
    font-size: 22px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .drawing-tools {
        top: auto;
        bottom: 100px;
        left: 10px;
        transform: none;
    }
    
    #timeline-container {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .playback-controls {
        order: 1;
    }
    
    .frame-tools {
        order: 2;
    }
    
    #timeline {
        order: 3;
    }
}
/* Custom cursor styles */
.cursor-pencil {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>') 0 24, auto;
}

.cursor-eraser {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><path d="M15.5 2H18a2 2 0 0 1 2 2v2.5"></path><path d="M22 14 16 8"></path></svg>') 0 24, auto;
}