* {
    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;
    padding: 20px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Content Area */
.content {
    display: grid;
    grid-template-columns: 350px 1fr;
    min-height: calc(100vh - 200px);
}

/* Sidebar */
.sidebar {
    background: #f9fafb;
    padding: 30px;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.sidebar h2 {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 25px 0;
}

/* Button Group */
.button-group {
    display: grid;
    gap: 10px;
}

.tab-btn {
    padding: 12px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-btn:hover {
    border-color: #4f46e5;
    background: #f0f9ff;
}

.tab-btn.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-color: #4f46e5;
}

/* Templates */
.templates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.template-btn {
    padding: 10px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.template-btn:hover {
    border-color: #4f46e5;
    background: #f0f9ff;
    transform: translateY(-2px);
}

/* Control Group */
.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.control-group input[type="text"],
.control-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s;
}

.control-group input[type="text"]:focus,
.control-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.control-group input[type="color"] {
    width: 100%;
    height: 45px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
}

.control-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Download Button */
.download-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

/* Preview Area */
.preview-area {
    padding: 30px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-header h2 {
    font-size: 1.5rem;
    color: #374151;
}

.size-info {
    background: #f3f4f6;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    background: #f9fafb;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: auto;
}

#canvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Preview Controls */
.preview-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.control-btn {
    flex: 1;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.control-btn:hover {
    border-color: #4f46e5;
    background: #f0f9ff;
    transform: translateY(-2px);
}

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

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

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* AI Controls */
.ai-controls {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.ai-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

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

.ai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-btn-small {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* AI Modal */
.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.ai-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ai-modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.ai-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ai-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.ai-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.ai-loading i {
    font-size: 3rem;
    color: #8b5cf6;
    margin-bottom: 15px;
}

.ai-loading p {
    font-size: 1.1rem;
}

/* AI Result Options */
.ai-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-option {
    padding: 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.ai-option:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.ai-option-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f2937;
    margin-bottom: 8px;
}

.ai-option-content {
    color: #6b7280;
    line-height: 1.6;
}

.ai-option-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #8b5cf6;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ai-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.ai-use-btn {
    flex: 1;
    padding: 8px 16px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-use-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Responsive */
@media (max-width: 1200px) {
    .content {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 968px) {
    .content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .ai-modal-content {
        width: 95%;
        max-height: 90vh;
    }
}
