*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

.container{
    display: flex;  
    height: 100vh;
    width: 100vw;
}
.sidebar{
    width: 260px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    padding: 10px;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
}

.canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    overflow: hidden;
}

/* Logo Header */
.logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logo-header:hover {
    transform: scale(1.03);
}

.logo-header:active {
    transform: scale(0.98);
}

.logo-img {
    width: 100%;
    max-width: 100px;
    height: auto;
    object-fit: cover;
    object-position: center;
    transition: all 0.2s ease;
    display: block;
    clip-path: inset(25% 10% 25% 10%);
}

.sidebar h2{
    color: #667eea;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
    margin-bottom: 5px;
}

.sidebar h3{
    color: #444;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tools-section,
.color-section,
.brush-section,
.grid-section,
.actions-section{
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
}

.tool-btn{
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    background: #fafafa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
}

.tool-btn:hover{
    border-color: #667eea;
    background: #f0f3ff;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.tool-btn.active{
    background: #667eea;
    color: white;
    border-color: #667eea;
}

#colorPicker{
    width: 100%;
    height: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#colorPicker:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.brush-section input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.brush-section span {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.grid-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.grid-preset-btn {
    padding: 8px;
    border: 2px solid #e0e0e0;
    background: #fafafa;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.grid-preset-btn:hover {
    border-color: #667eea;
    background: #f0f3ff;
}

.grid-preset-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.grid-section details {
    margin-top: 10px;
}

.grid-section summary {
    cursor: pointer;
    font-size: 12px;
    color: #666;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.grid-section summary:hover {
    background: #f5f5f5;
}

.grid-section details[open] summary {
    margin-bottom: 10px;
    color: #667eea;
    font-weight: 600;
}

.grid-section label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

.grid-section input[type="number"] {
    width: 70px;
    padding: 6px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.grid-section input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.action-btn {
    padding: 10px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(118, 75, 162, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.4);
}

#pixelCanvas {
   background: white;
   cursor: crosshair;
   display: block;
   image-rendering: -moz-crisp-edges;
   image-rendering: -webkit-crisp-edges;
   image-rendering: pixelated;
   image-rendering: crisp-edges;
}
/* Popup Styles */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.popup-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    position: relative;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.popup-close:hover {
    background: white;
    transform: rotate(90deg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 30px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.popup-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    object-position: center;
    margin-bottom: 15px;
    filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.2));
    background: linear-gradient(135deg, #7b8ff5 0%, #8a5eb8 100%);
    padding: 15px;
    border-radius: 10px;
}

.popup-header h2 {
    margin: 0;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.version {
    margin: 0;
    font-size: 16px;
    opacity: 0.95;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.popup-body {
    padding: 30px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.info-label {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.info-value {
    color: #333;
    font-size: 14px;
    text-align: right;
}

.github-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background: linear-gradient(135deg, #24292e 0%, #1a1e22 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(36, 41, 46, 0.3);
}

.github-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 41, 46, 0.4);
    background: linear-gradient(135deg, #2d333b 0%, #22272e 100%);
}

.github-btn svg {
    width: 20px;
    height: 20px;
}
