/**
 * Fantasy Settlement Generator - Public Styles
 */

/* Container */
.fsg-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f6f1;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Controls */
.fsg-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fsg-control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fsg-control-group label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fsg-input,
.fsg-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
    transition: border-color 0.2s;
}

.fsg-input:focus,
.fsg-select:focus {
    outline: none;
    border-color: #8b7355;
    box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.2);
}

.fsg-button {
    padding: 10px 20px;
    background: #8b7355;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-end;
}

.fsg-button:hover {
    background: #6d5a44;
}

.fsg-generate-btn {
    background: #2d5a27;
}

.fsg-generate-btn:hover {
    background: #1e4a1a;
}

/* Main Layout */
.fsg-main {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

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

/* Map Container */
.fsg-map-container {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fsg-map-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.fsg-settlement-name {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: #3d2914;
    font-family: Georgia, serif;
}

.fsg-settlement-description {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.fsg-map-wrapper {
    position: relative;
    background: #f4e4bc;
    border-radius: 4px;
    overflow: hidden;
}

.fsg-map {
    display: block;
    width: 100%;
    height: auto;
    min-height: 400px;
}

.fsg-map-legend {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #666;
}

.fsg-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fsg-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

/* Sidebar */
.fsg-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Panels */
.fsg-panel {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fsg-panel h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #3d2914;
    font-family: Georgia, serif;
}

.fsg-panel h4 {
    margin: 15px 0 8px 0;
    font-size: 14px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fsg-panel-content {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

.fsg-panel-content p {
    margin: 5px 0;
}

.fsg-panel-content hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 15px 0;
}

/* District Panel */
.fsg-district-type {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
}

.fsg-district-description {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

/* Lists */
.fsg-buildings-list,
.fsg-npcs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fsg-building-item,
.fsg-npc-item {
    padding: 10px;
    margin: 5px 0;
    background: #f9f6f1;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fsg-building-item:hover,
.fsg-npc-item:hover {
    background: #f0e8dc;
    transform: translateX(3px);
}

.fsg-building-item strong,
.fsg-npc-item strong {
    color: #3d2914;
    font-size: 14px;
}

.fsg-building-type,
.fsg-npc-role {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #e8e0d5;
    padding: 2px 8px;
    border-radius: 10px;
}

.fsg-empty {
    color: #999;
    font-style: italic;
    padding: 10px;
}

/* Back Button */
.fsg-back-btn {
    background: none;
    border: none;
    color: #8b7355;
    cursor: pointer;
    padding: 5px 0;
    font-size: 13px;
    margin-bottom: 10px;
    display: inline-block;
}

.fsg-back-btn:hover {
    color: #6d5a44;
    text-decoration: underline;
}

/* NPC Panel */
.fsg-npc-appearance,
.fsg-npc-personality,
.fsg-npc-greeting,
.fsg-npc-rumors {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
}

.fsg-npc-greeting blockquote {
    margin: 10px 0;
    padding: 10px 15px;
    background: #f9f6f1;
    border-left: 3px solid #8b7355;
    font-style: italic;
    color: #555;
}

.fsg-npc-rumors ul {
    padding-left: 20px;
    margin: 5px 0;
}

.fsg-npc-rumors li {
    margin: 5px 0;
    color: #666;
}

/* Building Panel */
.fsg-building-services,
.fsg-building-inventory {
    margin: 10px 0;
    font-size: 14px;
}

.fsg-inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}

.fsg-inventory-table th,
.fsg-inventory-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.fsg-inventory-table th {
    background: #f9f6f1;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.fsg-inventory-table tr:hover {
    background: #faf8f5;
}

/* Loading */
.fsg-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.fsg-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8b7355;
    border-radius: 50%;
    animation: fsg-spin 1s linear infinite;
}

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

.fsg-loading p {
    color: #fff;
    margin-top: 15px;
    font-size: 16px;
}

/* Error */
.fsg-error {
    padding: 15px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c00;
}

/* Map Only View */
.fsg-map-only {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fsg-map-only .fsg-settlement-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #3d2914;
    font-family: Georgia, serif;
    text-align: center;
}

/* District & NPC Cards (Shortcode) */
.fsg-district-card,
.fsg-npc-card {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 15px 0;
}

.fsg-district-card h3,
.fsg-npc-card h3 {
    margin: 0 0 5px 0;
    color: #3d2914;
    font-family: Georgia, serif;
}

.fsg-district-type-badge,
.fsg-npc-role-badge {
    display: inline-block;
    font-size: 11px;
    color: #fff;
    background: #8b7355;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.fsg-district-desc,
.fsg-npc-details p {
    color: #666;
    line-height: 1.6;
}

.fsg-district-buildings h4,
.fsg-district-npcs h4,
.fsg-npc-rumors h4,
.fsg-npc-secret h4 {
    margin: 15px 0 8px 0;
    color: #555;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fsg-district-buildings ul,
.fsg-district-npcs ul,
.fsg-npc-rumors ul {
    padding-left: 20px;
    margin: 0;
}

.fsg-district-buildings li,
.fsg-district-npcs li,
.fsg-npc-rumors li {
    margin: 5px 0;
    color: #444;
}

.fsg-npc-greeting {
    margin: 15px 0;
    padding: 15px;
    background: #f9f6f1;
    border-left: 3px solid #8b7355;
    font-style: italic;
}

.fsg-npc-secret {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.fsg-npc-secret h4 {
    margin-top: 0;
    color: #856404;
}

/* Responsive */
@media (max-width: 600px) {
    .fsg-controls {
        flex-direction: column;
    }

    .fsg-control-group {
        width: 100%;
    }

    .fsg-input,
    .fsg-select {
        width: 100%;
    }

    .fsg-button {
        width: 100%;
        margin-top: 10px;
    }
}
