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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0e0e10;
    color: #efeff1;
    min-height: 100vh;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #2f2f35;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #9146ff;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #00f5ff;
}

.stat-label {
    font-size: 12px;
    color: #adadb8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.creator-panel,
.preview-panel {
    background: #18181b;
    border: 1px solid #2f2f35;
    border-radius: 12px;
    padding: 24px;
}

.panel-header {
    margin-bottom: 24px;
}

.panel-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #efeff1;
}

.panel-header p {
    color: #adadb8;
    font-size: 14px;
}

.preview-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #2f2f35;
    border: none;
    border-radius: 6px;
    color: #efeff1;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover:not(:disabled) {
    background: #3a3a3d;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Input Section */
.input-section {
    margin-bottom: 24px;
}

.input-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #efeff1;
}

.input-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background: #2f2f35;
    border: 1px solid #464649;
    border-radius: 8px;
    color: #efeff1;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.input-section textarea:focus {
    outline: none;
    border-color: #9146ff;
}

.input-section textarea::placeholder {
    color: #adadb8;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #adadb8;
    margin-top: 4px;
}

/* Options Section */
.options-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-weight: 500;
    color: #efeff1;
}

.option-group select {
    padding: 10px 12px;
    background: #2f2f35;
    border: 1px solid #464649;
    border-radius: 6px;
    color: #efeff1;
    font-family: inherit;
    cursor: pointer;
}

.option-group select:focus {
    outline: none;
    border-color: #9146ff;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #efeff1;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    background: #2f2f35;
    border: 1px solid #464649;
    border-radius: 3px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #9146ff;
    border-color: #9146ff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #9146ff 0%, #7c3aed 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(145, 70, 255, 0.3);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-text {
    transition: opacity 0.2s ease;
}

.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.generate-btn.loading .btn-text {
    opacity: 0;
}

.generate-btn.loading .loading-spinner {
    display: block;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Preview Area */
.preview-area {
    background: #2f2f35;
    border: 2px dashed #464649;
    border-radius: 12px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.preview-area.has-image {
    border-style: solid;
    border-color: #9146ff;
    background: #1a1a1d;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0.6;
}

.preview-placeholder svg {
    stroke: #adadb8;
}

.preview-placeholder p {
    color: #adadb8;
    font-size: 14px;
}

.preview-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Size Previews */
.size-previews h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #efeff1;
}

.size-grid {
    display: flex;
    gap: 16px;
    align-items: end;
}

.size-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.size-item span {
    font-size: 12px;
    color: #adadb8;
}

.size-preview {
    background: #464649;
    border: 1px solid #5a5a5e;
    border-radius: 4px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.size-28 { width: 28px; height: 28px; }
.size-56 { width: 56px; height: 56px; }
.size-112 { width: 112px; height: 112px; }

/* Gallery */
.gallery {
    background: #18181b;
    border: 1px solid #2f2f35;
    border-radius: 12px;
    padding: 24px;
}

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

.gallery-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #efeff1;
}

.clear-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #464649;
    border-radius: 6px;
    color: #adadb8;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.gallery-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #adadb8;
    font-size: 14px;
}

.gallery-item {
    background: #2f2f35;
    border: 1px solid #464649;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.gallery-item:hover {
    border-color: #9146ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(145, 70, 255, 0.2);
}

.gallery-item img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.gallery-item-info {
    font-size: 12px;
    color: #adadb8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .size-grid {
        justify-content: center;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 12px;
    }
}

/* Animation for new gallery items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item.new {
    animation: slideIn 0.3s ease-out;
}

