* {
    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%);
    min-height: 100vh;
    overflow-x: hidden;
}

.design-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.design-header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content {
    flex: 1;
}

.design-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.design-subtitle {
    font-size: 1rem;
    color: #666;
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.clear-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.home-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Main Content Layout */
.main-content {
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

/* Brick Palette Sidebar */
.brick-palette {
    width: 300px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.brick-palette h2 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-align: center;
}

.palette-instructions {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
}

.palette-section {
    margin-bottom: 25px;
}

.palette-section h3 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.brick-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Brick Styles */
.brick {
    cursor: grab;
    position: relative;
    border-radius: 6px;
    padding: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    user-select: none;
}

.brick:active {
    cursor: grabbing;
}

.brick:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.brick-face {
    display: grid;
    gap: 4px;
    padding: 8px;
}

.brick-2x4 .brick-face {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.brick-2x2 .brick-face {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.brick-1x4 .brick-face {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr;
}

.stud {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.brick-label {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
    color: rgba(0, 0, 0, 0.6);
}

/* Brick Colors */
.brick-red {
    background: linear-gradient(145deg, #e53935, #c62828);
    border: 3px solid #b71c1c;
}

.brick-blue {
    background: linear-gradient(145deg, #2196f3, #1976d2);
    border: 3px solid #1565c0;
}

.brick-yellow {
    background: linear-gradient(145deg, #ffeb3b, #fdd835);
    border: 3px solid #f9a825;
}

.brick-green {
    background: linear-gradient(145deg, #4caf50, #388e3c);
    border: 3px solid #2e7d32;
}

.brick-orange {
    background: linear-gradient(145deg, #ff9800, #f57c00);
    border: 3px solid #e65100;
}

/* Design Canvas */
.design-canvas {
    flex: 1;
    background: linear-gradient(to bottom, #87ceeb 0%, #98d8e8 50%, #90c890 100%);
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    min-height: 600px;
}

.canvas-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.canvas-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: white;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.canvas-instructions.hidden {
    opacity: 0;
    pointer-events: none;
}

.canvas-instructions h3 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.canvas-instructions p {
    color: #666;
    font-size: 0.95rem;
    margin: 8px 0;
    text-align: left;
}

/* Placed Bricks on Canvas */
.placed-brick {
    position: absolute;
    cursor: move;
    z-index: 10;
    transition: box-shadow 0.2s ease;
}

.placed-brick:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 20;
}

.placed-brick:active {
    cursor: grabbing;
    z-index: 30;
}

/* Footer */
.design-footer {
    background: white;
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

/* Drag and Drop Effects */
.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.drag-over {
    background: linear-gradient(to bottom, #a8d8f0 0%, #b0e0f0 50%, #a8d8a8 100%);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .brick-palette {
        width: 100%;
        max-height: 300px;
    }

    .design-canvas {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .design-header {
        padding: 15px 20px;
    }

    .design-title {
        font-size: 1.8rem;
    }

    .design-subtitle {
        font-size: 0.85rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .action-btn {
        flex: 1;
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .brick-palette {
        padding: 15px;
    }

    .canvas-instructions {
        padding: 20px;
        max-width: 90%;
    }

    .canvas-instructions h3 {
        font-size: 1.4rem;
    }

    .canvas-instructions p {
        font-size: 0.85rem;
    }
}

/* Scrollbar Styling */
.brick-palette::-webkit-scrollbar {
    width: 8px;
}

.brick-palette::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.brick-palette::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.brick-palette::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

