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

body {
    background: radial-gradient(circle at 20% 30%, #1a2639, #0d1b2a);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.app-container {
    display: flex;
    background: rgba(18, 25, 40, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 48px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.sidebar {
    width: 320px;
    background: rgba(10, 15, 28, 0.7);
    backdrop-filter: blur(16px);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    overflow-y: auto;
    max-height: 90vh;
    scrollbar-width: thin;
    scrollbar-color: #4361ee #1e293b;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1e293b;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #4361ee;
    border-radius: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #4361ee, #b5179e);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 10px 20px -5px rgba(67, 97, 238, 0.4);
}

.logo-text {
    font-weight: 700;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #fff, #b0c4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    background: linear-gradient(135deg, #f72585, #b5179e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #98a9c7;
    margin-bottom: 12px;
}

.group-title i {
    font-size: 0.9rem;
    color: #4361ee;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: #b1c3e0;
    padding: 14px 0;
    border-radius: 20px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.tool-btn:hover {
    background: rgba(67, 97, 238, 0.2);
    color: white;
    transform: translateY(-2px);
    border-color: rgba(67, 97, 238, 0.3);
}

.tool-btn.active-tool {
    background: linear-gradient(135deg, #4361ee, #7209b7);
    color: white;
    box-shadow: 0 10px 20px -8px #4361ee;
    border-color: rgba(255, 255, 255, 0.2);
}

.brushes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.brush-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: #b1c3e0;
    padding: 12px 0;
    border-radius: 18px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.brush-btn:hover {
    background: rgba(247, 37, 133, 0.2);
    color: white;
}

.brush-btn.active-brush {
    background: linear-gradient(135deg, #f72585, #b5179e);
    color: white;
    box-shadow: 0 8px 16px -6px #f72585;
}

.size-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 60px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
}

.size-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.size-value {
    font-weight: 700;
    font-size: 1.6rem;
    color: white;
    min-width: 45px;
    text-align: center;
}

.size-label {
    font-size: 0.8rem;
    color: #98a9c7;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 40px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.icon-btn:hover {
    background: rgba(67, 97, 238, 0.6);
}

.opacity-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.opacity-control label {
    font-size: 0.7rem;
    color: #98a9c7;
    margin-left: 5px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    -webkit-appearance: none;
}

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

.shape-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.shape-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: #b1c3e0;
    padding: 12px 0;
    border-radius: 18px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.shape-btn:hover {
    background: rgba(76, 201, 240, 0.2);
    color: white;
}

.shape-btn.active-shape {
    background: linear-gradient(135deg, #4cc9f0, #4895ef);
    color: white;
    box-shadow: 0 8px 16px -6px #4cc9f0;
}

.color-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 40px;
    padding: 5px 10px 5px 5px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#color {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    cursor: pointer;
    background: transparent;
}

.color-hex {
    font-family: monospace;
    font-size: 0.9rem;
    color: #b1c3e0;
}

.swatches {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.swatch {
    aspect-ratio: 1;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.15s;
}

.swatch:hover {
    transform: scale(1.15);
    border-color: white;
    box-shadow: 0 5px 12px rgba(0,0,0,0.3);
}

.action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: #eef3fc;
    padding: 12px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
}

.action-btn i {
    font-size: 1rem;
    color: #4cc9f0;
}

.action-btn:hover {
    background: rgba(67, 97, 238, 0.3);
    border-color: rgba(67, 97, 238, 0.4);
    transform: translateY(-2px);
}

.copilot-section, .layers-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.canvas-area {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-wrapper {
    position: relative;
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 30px 45px -20px black;
}

#canvas {
    display: block;
    background: white;
    cursor: crosshair;
    width: 1000px;
    height: 700px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
}

.canvas-overlay.grid-active {
    background-image: 
        linear-gradient(rgba(67, 97, 238, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(67, 97, 238, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: rgba(10, 15, 28, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #b1c3e0;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-left, .footer-center, .footer-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background: #4cc9f0;
    border-radius: 50%;
    box-shadow: 0 0 12px #4cc9f0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.separator {
    color: #2d3b52;
    font-weight: 300;
}

.footer-btn {
    background: none;
    border: none;
    color: #b1c3e0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 30px;
    transition: 0.2s;
    position: relative;
}

.footer-btn:hover {
    background: rgba(67, 97, 238, 0.2);
    color: white;
}

.footer-btn.danger:hover {
    background: rgba(247, 37, 133, 0.3);
    color: #ff8ab5;
}

.footer-btn.success:hover {
    background: rgba(76, 201, 240, 0.2);
    color: #4cc9f0;
}

#zoomLevel {
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    color: white;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: #1e293b;
    color: white;
    font-size: 0.7rem;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
    margin-bottom: 8px;
}

[data-tooltip]:hover:before {
    opacity: 1;
}