/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 2rem;
    text-align: center;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cat-emoji {
    font-size: 3rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.app-subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
}

/* Main Drawing Workspace */
.drawing-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    padding: 2rem;
    align-items: start;
}

/* Canvas Section */
.canvas-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.canvas-container {
    display: inline-block;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
}

#cat-canvas {
    display: block;
    background: white;
}

.canvas-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* Controls Section */
.controls-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: 70vh;
    overflow-y: auto;
}

.component-categories {
    margin-bottom: 2rem;
}

.category-group {
    margin-bottom: 2rem;
}

.category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
}

.component-btn {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

.component-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.component-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.component-preview {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

/* Color Section */
.color-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 1.5rem;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.color-btn {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.color-btn.active {
    border-color: #2c3e50;
    border-width: 4px;
    transform: scale(1.15);
}

/* Footer */
.app-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    color: #666;
}

.footer-links {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .drawing-workspace {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .controls-section {
        max-height: none;
        order: -1;
    }
}

@media (max-width: 768px) {
    .app-title {
        font-size: 2rem;
    }
    
    .drawing-workspace {
        padding: 1rem;
    }
    
    #cat-canvas {
        width: 100%;
        max-width: 350px;
        height: auto;
    }
    
    .canvas-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 1.1rem;
        min-width: 200px;
    }
    
    .component-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .color-palette {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .color-btn {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 1rem;
    }
    
    .app-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0;
    }
    
    .cat-emoji {
        font-size: 2rem;
    }
    
    .drawing-workspace {
        padding: 0.5rem;
    }
    
    .canvas-section,
    .controls-section {
        padding: 1rem;
    }
    
    .component-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading and Transition Effects */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
.controls-section::-webkit-scrollbar {
    width: 6px;
}

.controls-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.controls-section::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.controls-section::-webkit-scrollbar-thumb:hover {
    background: #999;
}