/**
 * Lankhmar Image Generator - Styles
 */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
}

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

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

.header h1 {
    color: #d4af37;
    font-size: 2rem;
    font-weight: normal;
}

.campaign-context {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2a2a2a;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #444;
}

#campaign-info {
    font-weight: bold;
    color: #d4af37;
}

/* ===== NAVIGATION ===== */
.main-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.nav-btn {
    padding: 12px 24px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #3a3a3a;
    border-color: #d4af37;
}

.nav-btn.active {
    background: #d4af37;
    color: #1a1a1a;
    border-color: #d4af37;
}

/* ===== VIEWS ===== */
.view {
    display: none;
}

.view.active {
    display: block;
}

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

.view-header h2 {
    color: #d4af37;
    font-size: 1.8rem;
    font-weight: normal;
}

.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    padding: 8px 16px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #3a3a3a;
}

.filter-btn.active {
    background: #444;
    border-color: #d4af37;
}

/* ===== ENTITIES GRID ===== */
.entities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.entity-card {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.entity-card:hover {
    border-color: #d4af37;
    transform: translateY(-2px);
}

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

.entity-header h3 {
    color: #d4af37;
    font-size: 1.4rem;
}

.entity-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.entity-badge-pc { background: #2e7d32; color: white; }
.entity-badge-npc { background: #1976d2; color: white; }
.entity-badge-monster { background: #c62828; color: white; }
.entity-badge-location { background: #f57c00; color: white; }
.entity-badge-item { background: #7b1fa2; color: white; }
.entity-badge-environment { background: #455a64; color: white; }

.entity-body {
    margin-bottom: 15px;
}

.entity-meta {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 8px;
}

.entity-description {
    margin-bottom: 10px;
    line-height: 1.5;
}

.entity-priority {
    background: #3a2a1a;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #d4af37;
    font-size: 0.9rem;
    margin-top: 10px;
}

.entity-stats {
    display: flex;
    gap: 15px;
    color: #999;
    font-size: 0.9rem;
    margin-top: 10px;
}

.entity-actions {
    display: flex;
    gap: 8px;
}

/* ===== BUTTONS ===== */
.btn-primary {
    padding: 10px 20px;
    background: #d4af37;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #e4bf47;
}

.btn-secondary {
    padding: 10px 20px;
    background: #444;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: #555;
}

.btn-small {
    padding: 6px 12px;
    background: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-small:hover {
    background: #4a4a4a;
}

.btn-small.btn-primary {
    background: #d4af37;
    color: #1a1a1a;
    border: none;
}

.btn-icon {
    padding: 8px 12px;
    background: transparent;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
}

.btn-icon:hover {
    background: #3a3a3a;
}

.btn-danger {
    background: #c62828;
    color: white;
    border-color: #c62828;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-close {
    font-size: 2rem;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
}

.btn-close:hover {
    color: #e0e0e0;
}

.btn-generate {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #d4af37 0%, #f4cf47 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 20px;
}

.btn-generate:hover {
    transform: scale(1.02);
}

/* ===== FORMS ===== */
.form-section {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

label {
    display: block;
    color: #d4af37;
    margin-bottom: 8px;
    font-weight: bold;
}

.input-text,
.input-select,
.input-textarea {
    width: 100%;
    padding: 10px;
    background: #333;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.input-text:focus,
.input-select:focus,
.input-textarea:focus {
    outline: none;
    border-color: #d4af37;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #444;
}

.modal-header h2 {
    color: #d4af37;
    font-size: 1.5rem;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #444;
}

/* ===== REPEATABLE ITEMS ===== */
.repeatable-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.repeatable-item {
    background: #333;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #555;
}

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

.item-meta {
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
}

.empty-list {
    color: #999;
    font-style: italic;
}

/* ===== GENERATE PANEL ===== */
.generate-panel {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #444;
}

.entity-preview,
.style-preview {
    background: #333;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    border-left: 3px solid #d4af37;
}

.generation-result {
    margin-top: 30px;
}

.result-card {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #2e7d32;
}

.result-card h3 {
    color: #4caf50;
    margin-bottom: 15px;
}

.result-card pre {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== GALLERY ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    border-color: #d4af37;
    transform: translateY(-2px);
}

.gallery-image {
    width: 100%;
    height: 250px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-info {
    padding: 15px;
}

.gallery-name {
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 5px;
}

.gallery-style {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.gallery-filename {
    font-family: monospace;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
}

.gallery-scene {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.gallery-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* ===== STYLES VIEW ===== */
.style-family {
    margin-bottom: 40px;
}

.style-family-name {
    color: #d4af37;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #444;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.style-card {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.style-card:hover {
    border-color: #d4af37;
}

.style-custom {
    border-left: 4px solid #7b1fa2;
}

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

.style-header h4 {
    color: #d4af37;
    font-size: 1.2rem;
}

.style-variation {
    background: #444;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.style-description {
    margin-bottom: 10px;
    font-style: italic;
}

.style-technique {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 10px;
}

.style-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
    color: #999;
    margin-top: 10px;
}

.badge-custom {
    background: #7b1fa2;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.style-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #444;
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 20px;
    color: #d4af37;
    font-size: 1.2rem;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }

    .main-nav {
        flex-wrap: wrap;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .entities-grid,
    .gallery-grid,
    .style-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 100%;
        margin: 10px;
    }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }

/* ===== PROMPT WIZARD ===== */
.wizard-section {
    margin-bottom: 25px;
    background: #333;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #d4af37;
}

.wizard-section h3 {
    color: #d4af37;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.wizard-question {
    margin-bottom: 20px;
}

.wizard-question label {
    color: #e0e0e0;
    font-weight: normal;
    margin-bottom: 10px;
}

.wizard-radio-group,
.wizard-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wizard-radio-option,
.wizard-checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wizard-radio-option:hover,
.wizard-checkbox-option:hover {
    background: #3a3a3a;
    border-color: #d4af37;
}

.wizard-radio-option input[type="radio"],
.wizard-checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.wizard-radio-option.selected,
.wizard-checkbox-option.selected {
    background: #3a3a3a;
    border-color: #d4af37;
}

.wizard-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.wizard-input-row input {
    flex: 1;
}

.wizard-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
}

.wizard-textarea:focus {
    outline: none;
    border-color: #d4af37;
}

.prompt-preview {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #d4af37;
    margin-bottom: 20px;
}

.prompt-preview h3 {
    color: #d4af37;
    margin-bottom: 15px;
}

.wizard-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    align-items: center;
}

.wizard-nav-buttons {
    display: flex;
    gap: 10px;
}

.help-text {
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

.wizard-credit-warning {
    background: #3a2a1a;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #d4af37;
    margin-top: 20px;
}

.wizard-credit-warning strong {
    color: #d4af37;
}