@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&family=Cormorant+Garamond:wght@400;600;700&display=swap');

:root {
    --primary-color: #3e2723;
    --secondary-color: #795548;
    --accent-color: #d4af37;
    --text-color: #212121;
    --light-color: #f5f5f5;
    --paper-color: #f8f3e3;
    --border-color: #8d6e63;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Cormorant Garamond', serif;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23d1bfa7' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-family: 'MedievalSharp', cursive;
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 3px var(--shadow-color);
}

h2, h3, h4 {
    font-family: 'MedievalSharp', cursive;
    color: var(--secondary-color);
    margin: 1rem 0;
}

header p {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.kingdom-controls {
    background-color: var(--paper-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 8px var(--shadow-color);
}

#generateBtn {
    display: block;
    margin: 0 auto 1.5rem;
    padding: 0.8rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'MedievalSharp', cursive;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all 0.3s ease;
}

#generateBtn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.customize-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.option {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--light-color);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3rem 0;
}

.loading-animation {
    text-align: center;
}

.crown {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 60' fill='%23d4af37'%3E%3Cpath d='M10,50 L20,20 L40,40 L50,10 L60,40 L80,20 L90,50 L10,50 Z'/%3E%3Cpath d='M15,55 L85,55 L85,60 L15,60 Z'/%3E%3Ccircle cx='20' cy='20' r='5'/%3E%3Ccircle cx='50' cy='10' r='5'/%3E%3Ccircle cx='80' cy='20' r='5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    animation: float 2s ease-in-out infinite alternate;
}

@keyframes float {
    from {
        transform: translateY(0) rotate(0deg);
    }
    to {
        transform: translateY(-10px) rotate(5deg);
    }
}

.loading-text {
    font-family: 'MedievalSharp', cursive;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.kingdom-output {
    background-color: var(--paper-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.kingdom-map {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background-color: #f0e6d2;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    background-color: var(--border-color);
    color: white;
}

.tab-pane {
    display: none;
    padding: 1rem 0;
}

.tab-pane.active {
    display: block;
}

.hidden {
    display: none;
}

/* Style for the generated content */
.tab-pane h3 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.tab-pane p {
    margin-bottom: 1rem;
    text-align: justify;
}

.tab-pane ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.tab-pane li {
    margin-bottom: 0.5rem;
}

.notable-person {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--border-color);
}

.notable-person:last-child {
    border-bottom: none;
}

.kingdom-name {
    font-family: 'MedievalSharp', cursive;
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin: 0 0 1.5rem;
    text-shadow: 1px 1px 2px var(--shadow-color);
}

.ai-tools-container {
    margin-top: 2rem;
    background-color: var(--paper-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.ai-tools-header {
    font-family: 'MedievalSharp', cursive;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.ai-tools-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ai-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-family: 'MedievalSharp', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-button:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

.ai-content {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f0e6d2;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.kingdom-ai-image, .coat-of-arms {
    width: 100%;
    max-width: 400px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin: 0 auto;
    display: block;
}

.coat-of-arms {
    max-width: 200px;
    margin-top: 1rem;
}

.image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .customize-options {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .ai-tools-options {
        flex-direction: column;
    }
    
    .kingdom-ai-image, .coat-of-arms {
        max-width: 100%;
    }
}