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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
header {
    background: #0a0a0a;
    border-bottom: 1px solid #2a2a2a;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: #ffffff;
}

.header-content p {
    font-size: 1.1rem;
    color: #888;
    font-weight: 400;
}

/* Main Container */
.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px;
    display: grid;
    grid-template-columns: 30% 20% 50%;
    gap: 40px;
    min-height: calc(100vh - 160px);
}

/* Panels */
.left-panel, .center-panel, .right-panel {
    background: #111111;
    border-radius: 16px;
    border: 1px solid #2a2a2a;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: #1a1a1a;
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a2a;
}

.panel-header h2 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: -0.01em;
}

/* Left Panel - Keywords */
.keyword-section {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.keyword-group {
    margin-bottom: 32px;
}

.keyword-group:last-child {
    margin-bottom: 0;
}

.keyword-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: #ffffff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: normal;
    color: #e0e0e0;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.checkbox-group label:hover {
    background: #1f1f1f;
    border-color: #333;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    accent-color: #ffffff;
}

.checkbox-group input[type="checkbox"]:checked + span {
    color: #ffffff;
}

select, input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #ffffff;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #444;
    background: #1f1f1f;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

select option {
    background: #1a1a1a;
    color: #ffffff;
}

.control-buttons {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.btn:hover:before {
    left: 100%;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
}

.btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background: transparent;
    color: #888;
    border: 1px solid #2a2a2a;
}

.btn-secondary:hover {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #444;
}

.btn-generate {
    width: 100%;
    background: #ffffff;
    color: #000000;
    padding: 16px;
    font-size: 1rem;
    margin-top: 20px;
}

.btn-generate:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

.btn-download {
    background: transparent;
    color: #ffffff;
    border: 1px solid #444;
    flex: 1;
}

.btn-download:hover {
    background: #1a1a1a;
    border-color: #666;
}

/* Center Panel - Prompt */
.prompt-container {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.prompt-display {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    min-height: 200px;
    font-style: italic;
    color: #666;
    text-align: left;
    line-height: 1.6;
    font-size: 0.95rem;
    flex: 1;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.prompt-display.active {
    border-color: #444;
    background: #1f1f1f;
    color: #e0e0e0;
    font-style: normal;
}

.generate-section {
    margin-top: 20px;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid #2a2a2a;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading p {
    color: #888;
    font-size: 0.9rem;
}

.status-info {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    border: 1px solid #2a2a2a;
}

.status-info h3 {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#status-text {
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Right Panel - Image */
.image-container {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.placeholder {
    background: #1a1a1a;
    border: 2px dashed #2a2a2a;
    border-radius: 12px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.placeholder:hover {
    border-color: #333;
    background: #1f1f1f;
}

.placeholder-text h3 {
    font-size: 1.5rem;
    font-weight: 300;
    color: #666;
    margin-bottom: 8px;
}

.placeholder-text p {
    color: #444;
    font-size: 0.95rem;
}

.image-result {
    display: none;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#generated-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
    background: #1a1a1a;
}

.image-info {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
}

.image-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-details span {
    font-size: 0.85rem;
    color: #666;
}

.image-actions {
    display: flex;
    gap: 12px;
}

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

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 35% 25% 40%;
        gap: 30px;
        padding: 30px;
    }

    .header-content {
        padding: 0 30px;
    }
}

@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .header-content {
        padding: 0 20px;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .checkbox-group {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 8px;
    }

    .control-buttons {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .header-content h1 {
        font-size: 1.75rem;
    }

    .header-content p {
        font-size: 1rem;
    }

    .main-container {
        padding: 15px;
        gap: 15px;
    }

    .panel-header {
        padding: 16px 20px;
    }

    .keyword-section,
    .prompt-container,
    .image-container {
        padding: 20px;
    }

    .btn-generate {
        padding: 14px;
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.image-result.show {
    animation: fadeIn 0.5s ease-out;
}

/* Hover Effects */
.keyword-group label:hover,
.checkbox-group label:hover {
    transform: translateX(2px);
}

.btn:hover {
    transform: translateY(-1px);
}

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