* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.header-gradient {
    background: linear-gradient(135deg, #4A90E2 0%, #7B68EE 50%, #FF6B9D 100%);
}

.tab-button {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Nunito', sans-serif;
}

.tab-button:hover {
    color: #4A90E2;
}

.tab-button.active {
    color: #4A90E2;
    border-bottom-color: #4A90E2;
}

.sidebar {
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 320px;
        transform: translateX(-100%);
        z-index: 40;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar-open {
        transform: translateX(0);
    }
}

.accordion {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.accordion:hover {
    border-color: #4A90E2;
}

.accordion-summary {
    padding: 12px 16px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    color: #2C3E50;
    list-style: none;
    user-select: none;
    transition: background 0.2s ease;
}

.accordion-summary::-webkit-details-marker {
    display: none;
}

.accordion-summary:hover {
    background: #f8f9fa;
}

.accordion-content {
    padding: 16px;
    background: #fafbfc;
}

.option-button {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #2C3E50;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.option-button:hover {
    border-color: #4A90E2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.2);
}

.option-button.active {
    background: linear-gradient(135deg, #4A90E2, #7B68EE);
    color: white;
    border-color: #4A90E2;
}

.preset-button {
    padding: 8px 14px;
    background: linear-gradient(135deg, #FF8C42, #FF6B9D);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

.generate-button {
    padding: 16px 24px;
    background: linear-gradient(135deg, #FF8C42, #FF6B9D);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
    font-family: 'Nunito', sans-serif;
}

.generate-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.save-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #7BC96F, #5AAD4E);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(123, 201, 111, 0.3);
}

.save-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(123, 201, 111, 0.4);
}

.save-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.canvas-area {
    background: #e9ecef;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.canvas-placeholder {
    background: #f8f9fa;
    border: 3px dashed #cbd5e0;
    border-radius: 16px;
    padding: 64px 24px;
    text-align: center;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e5e7eb;
    border-top-color: #FF8C42;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FF6B9D;
    animation: confetti-fall 3s linear forwards;
    opacity: 0;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

textarea:focus,
input:focus,
button:focus {
    outline: none;
}

@media (max-width: 640px) {
    .canvas-placeholder {
        min-height: 300px;
        padding: 32px 16px;
    }
}