* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.drawer-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    backdrop-filter: blur(10px);
}

.drawer-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.drawer-toggle svg {
    transition: transform 0.3s ease;
}

.drawer-toggle.active svg {
    transform: rotate(90deg);
}

.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    position: relative;
}

.drawer {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 350px;
    max-width: 90vw;
    transform: translateX(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10;
    flex-shrink: 0;
    position: relative;
}

.drawer.collapsed {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.drawer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
    transition: all 0.3s ease;
}

.main-content.drawer-collapsed .main-section {
    margin-left: 0;
}

.actions-info-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.actions-info-row .control-group {
    flex: 1;
    margin-bottom: 0;
}

.control-group {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    width: 100%;
}

.controls-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.parameters-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-end;
}

.parameters-row:last-child {
    margin-bottom: 0;
}

.parameters-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.colors-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-end;
}

.colors-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.gradient-controls {
    margin-top: 10px;
}

.gradient-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.gradient-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.control-group h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1f2937;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: #4b5563;
}

.input-group input[type="number"],
.input-group input[type="range"] {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.input-group input[type="number"]:focus,
.input-group input[type="range"]:focus {
    outline: none;
    border-color: #3b82f6;
}

.input-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.input-group input[type="color"]:hover {
    border-color: #3b82f6;
}

.input-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
}

.input-group input[type="checkbox"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.input-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.value-display {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3b82f6;
    min-width: 40px;
}

.preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.preset-btn {
    padding: 10px 15px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.preset-btn:active {
    transform: translateY(0);
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.mobile_info {
    font-size: 1.2rem;
    opacity: 0.8;
    color: rgb(176, 30, 30);
}

.canvas-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.canvas-container:hover {
    background: #f3f4f6;
    transform: scale(1.01);
}

.fullscreen-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.canvas-container:hover .fullscreen-hint {
    opacity: 1;
}

.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.fullscreen-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.fullscreen-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.close-fullscreen {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
}

.close-fullscreen:hover {
    background: #dc2626;
    transform: scale(1.1);
}

#fullscreenCanvas {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    max-width: 90vw;
    max-height: 80vh;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#spirographCanvas {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    max-width: 100%;
    height: auto;
}

.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    color: white;
    margin-top: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-content p {
    margin: 5px 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.info-content {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.6;
}

.info-content p {
    margin-bottom: 10px;
}

.info-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.info-content li {
    margin-bottom: 5px;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .drawer {
        width: 100%;
        max-width: none;
        position: relative;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .drawer.collapsed {
        display: none;
    }
    
    .drawer-toggle {
        display: block;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .controls-section {
        padding: 20px;
    }
    
    .control-group {
        padding: 15px;
    }
    
    .parameters-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .parameters-row .input-group {
        margin-bottom: 10px;
    }
    
    .parameters-row .input-group:last-child {
        margin-bottom: 0;
    }
    
    .colors-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .colors-row .input-group {
        margin-bottom: 10px;
    }
    
    .colors-row .input-group:last-child {
        margin-bottom: 0;
    }
    
    .gradient-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .gradient-row .input-group {
        margin-bottom: 10px;
    }
    
    .gradient-row .input-group:last-child {
        margin-bottom: 0;
    }
    
    .actions-info-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .actions-info-row .control-group {
        margin-bottom: 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
    }
    
    #spirographCanvas {
        width: 100%;
        height: auto;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
    
    .mobile_info {
        display: none !important;
    }
}

/* Animation for loading state */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.generating {
    animation: pulse 1.5s ease-in-out infinite;
}