/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .spell-description {
        font-size: 16px;
    }
    
    .spell-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .spell-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .spell-meta {
        justify-content: center;
    }
    
    .mob-selection {
        flex-direction: column;
    }
    
    .mob-card {
        width: 100%;
    }
    
    /* Form improvements for mobile */
    .form-group {
        width: 100%;
        margin: 0 0 15px 0;
    }
    
    select, input[type="text"], input[type="email"], textarea {
        height: 48px;
        font-size: 16px;
        padding: 12px;
        width: 100%;
    }
    
    textarea {
        height: auto;
        min-height: 100px;
    }
    
    /* Larger buttons for touch */
    .btn {
        padding: 14px 20px;
        font-size: 18px;
        min-height: 50px;
        min-width: 100px;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 20px;
    }
    
    /* Improve touch accessibility */
    a, button, .btn, .nav-link, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Add focus states for accessibility */
    a:focus, button:focus, input:focus, select:focus, textarea:focus {
        outline: 2px solid #3498db;
        outline-offset: 2px;
    }
    
    /* Increase spacing between interactive elements */
    .form-group + .form-group,
    .btn + .btn,
    li + li {
        margin-top: 16px;
    }
    
    /* Remove hover effects and replace with active state for touch */
    .btn:hover,
    .nav-link:hover,
    .stat-card:hover {
        transform: none;
    }
    
    .btn:active,
    .nav-link:active,
    .stat-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .spell-result {
        padding: 15px;
    }
    
    .btn {
        font-size: 16px;
        padding: 12px 16px;
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #f5f5f5;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="%23f0f0f0" d="M21.5 35.5l-8.2-8.2c-1.6-1.6-1.6-4.1 0-5.7l8.2-8.2c1.6-1.6 4.1-1.6 5.7 0l8.2 8.2c1.6 1.6 1.6 4.1 0 5.7l-8.2 8.2c-1.6 1.6-4.1 1.6-5.7 0zm51.5 0l-8.2-8.2c-1.6-1.6-1.6-4.1 0-5.7l8.2-8.2c1.6-1.6 4.1-1.6 5.7 0l8.2 8.2c1.6 1.6 1.6 4.1 0 5.7l-8.2 8.2c-1.6 1.6-4.1 1.6-5.7 0z"/></svg>');
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

h2 {
    color: #3498db;
    margin-top: 20px;
}

h3 {
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Form styles */
.generator-form {
    margin-bottom: 30px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 20px;
}

input[type="text"], input[type="email"], textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, transform 0.2s;
    min-height: 44px;
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

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

/* Spell result styles */
.spell-result {
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.spell-result:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Rarity stylings */
.spell-rarity-common {
    border: 2px solid #9e9e9e;
}

.spell-rarity-uncommon {
    border: 2px solid #2ecc71;
}

.spell-rarity-rare {
    border: 2px solid #3498db;
}

.spell-rarity-epic {
    border: 2px solid #9b59b6;
}

.spell-rarity-legendary {
    border: 2px solid #f1c40f;
    background-image: linear-gradient(to bottom right, rgba(255, 215, 0, 0.05), rgba(255, 215, 0, 0.1));
}

/* Spell header styling */
.spell-header {
    padding: 15px;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.spell-icon {
    flex-shrink: 0;
    margin-right: 15px;
}

.placeholder-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.spell-info {
    flex-grow: 1;
}

.spell-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.spell-detail-row {
    display: flex;
    align-items: baseline;
    font-size: 16px;
    line-height: 1.6;
}

.spell-label {
    font-weight: bold;
    margin-right: 8px;
    color: #2c3e50;
    min-width: 120px;
}

.spell-school {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 10px;
    border-radius: 20px;
}

.spell-rarity {
    padding: 2px 10px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
}

.spell-rarity-common .spell-rarity {
    background-color: #9e9e9e;
}

.spell-rarity-uncommon .spell-rarity {
    background-color: #2ecc71;
}

.spell-rarity-rare .spell-rarity {
    background-color: #3498db;
}

.spell-rarity-epic .spell-rarity {
    background-color: #9b59b6;
}

.spell-rarity-legendary .spell-rarity {
    background-color: #f1c40f;
    color: #000;
}

.spell-mana {
    color: #3498db;
    font-weight: bold;
}

.mana-symbol {
    color: #3498db;
}

/* Spell body styling */
.spell-body {
    padding: 20px;
}

.spell-description {
    font-size: 18px;
    line-height: 1.8;
    font-style: italic;
    margin-bottom: 20px;
}

/* Rarity debug section */
.rarity-debug {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    font-family: monospace;
    font-size: 14px;
}

.rarity-debug h3 {
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    font-size: 16px;
}

.rarity-debug ul {
    list-style-type: none;
}

.rarity-debug li {
    padding: 3px 0;
    border-bottom: 1px dotted #eee;
}

/* History styles */
.spell-history {
    margin-top: 30px;
}

.spell-history ul {
    list-style-type: none;
}

.history-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-spell-name {
    font-weight: bold;
    flex-grow: 1;
}

.history-spell-rarity {
    opacity: 0.7;
    font-weight: normal;
}

.history-spell-school {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 14px;
}

.history-spell-mana {
    color: #3498db;
    font-weight: bold;
}

/* School-specific styling */
.spell-result .placeholder-icon {
    background-color: #3498db; /* Default blue */
}

/* School customizations - colors for the placeholder icon */
.Fire .placeholder-icon {
    background-color: #e74c3c;
}

.Ice .placeholder-icon {
    background-color: #3498db;
}

.Lightning .placeholder-icon {
    background-color: #f39c12;
}

.Earth .placeholder-icon {
    background-color: #795548;
}

.Water .placeholder-icon {
    background-color: #2980b9;
}

.Wind .placeholder-icon {
    background-color: #7f8c8d;
}

.Shadow .placeholder-icon {
    background-color: #34495e;
}

.Light .placeholder-icon {
    background-color: #f1c40f;
    color: #000;
}

/* Mob card styling - restored to previous version */
.mob-card {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.mob-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.mob-card.active {
    border-color: #3498db;
    background-color: #ebf5fb;
}

.mob-icon {
    width: 40px;
    height: 40px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.mob-info {
    flex-grow: 1;
}

.mob-name {
    font-weight: bold;
    font-size: 14px;
}

.mob-hp {
    font-size: 12px;
    color: #e74c3c;
}

.fight-count {
    font-size: 10px;
    color: #777;
    margin-top: 3px;
}

/* Animation for attacking the same enemy - made more subtle */
.mob-card.attacking {
    animation: attack-pulse 0.3s ease;
}

@keyframes attack-pulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

/* Combat log styling */
.combat-log {
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.combat-log h5 {
    margin: 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.log-container {
    max-height: 150px;
    overflow-y: auto;
    padding: 0;
}

#combat-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#combat-log-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

#combat-log-list li:nth-child(odd) {
    background-color: #f9f9f9;
}

#combat-log-list li.crit {
    color: #e74c3c;
    font-weight: bold;
}

#combat-log-list li.miss {
    color: #7f8c8d;
    font-style: italic;
}

/* Statistics styling - simplified table layout */
.stats-container {
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.stats-container h5 {
    margin: 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.stats-table td:nth-child(odd) {
    font-weight: bold;
    color: #555;
}

.stats-table td:nth-child(even) {
    font-family: monospace;
    font-size: 14px;
    color: #3498db;
    text-align: right;
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.combat-result {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #3498db;
}

.combat-result h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c3e50;
}

.hp-display {
    margin-bottom: 15px;
}

.hp-text {
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: bold;
}

.hp-bar-container {
    height: 20px;
    background-color: #ecf0f1;
    border-radius: 10px;
    margin-bottom: 5px;
    overflow: hidden;
}

.hp-bar {
    height: 100%;
    width: 100%;
    background-color: #4CAF50;
    transition: width 0.5s ease, background-color 0.5s ease;
}

/* Hit type indicators */
.hit-type {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.hit-type.critical-hit {
    color: #e74c3c;
    animation: pulse 0.5s infinite alternate;
}

.hit-type.miss {
    color: #7f8c8d;
    font-style: italic;
}

.hit-type.normal-hit {
    color: #3498db;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.result-message {
    font-size: 16px;
    margin-bottom: 10px;
}

.defeat-message {
    font-style: italic;
    color: #8e44ad;
    margin-top: 15px;
    padding: 10px;
    background-color: #f0e6f6;
    border-radius: 5px;
    font-size: 14px;
}

.debug-info {
    font-family: monospace;
    font-size: 12px;
    color: #7f8c8d;
    padding: 5px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

/* User Location Styling */
.user-location {
    text-align: right;
    margin-bottom: 20px;
    font-size: 14px;
    color: #777;
}

.location-info {
    display: inline-block;
    padding: 5px 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.location-label {
    font-weight: bold;
    margin-right: 5px;
}

.location-value {
    color: #3498db;
}

/* Visitor styling */
.visitor-greeting {
    text-align: center;
    padding: 12px;
    margin-bottom: 20px;
    background-color: #f0ecf5;
    border-radius: 8px;
    font-size: 16px;
    color: #555;
    border-bottom: 2px solid #8e44ad;
}

.visitor-title {
    font-weight: bold;
    color: #8e44ad;
}

.visitor-country {
    font-weight: bold;
}

.grimoire-link {
    display: inline-block;
    margin-left: 15px;
    padding: 3px 10px;
    background-color: #8e44ad;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.grimoire-link:hover {
    background-color: #703688;
}

/* Home link styling */
.home-link {
    margin: 20px 0;
    text-align: center;
}

.home-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.home-link a:hover {
    text-decoration: underline;
}

/* Visitor stats styling */
.visitor-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    color: #8e44ad;
    font-weight: bold;
}

/* Navigation links styling */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.back-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white !important; /* Force white text */
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-weight: bold;
    position: relative;
    z-index: 10; /* Ensure text is above any background */
    text-align: center;
}

.back-link:hover {
    background-color: #2980b9;
}

/* Add general responsive image handling */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy loading placeholder styling */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Responsive background patterns */
@media (max-width: 768px) {
    body {
        background-image: url('data:image/svg+xml;utf8,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><path fill="%23f0f0f0" d="M12.9 21.3l-4.9-4.9c-1-1-1-2.5 0-3.4l4.9-4.9c1-1 2.5-1 3.4 0l4.9 4.9c1 1 1 2.5 0 3.4l-4.9 4.9c-1 1-2.5 1-3.4 0zm30.9 0l-4.9-4.9c-1-1-1-2.5 0-3.4l4.9-4.9c1-1 2.5-1 3.4 0l4.9 4.9c1 1 1 2.5 0 3.4l-4.9 4.9c-1 1-2.5 1-3.4 0z"/></svg>');
        background-size: 60px 60px;
    }
}

@media (max-width: 480px) {
    body {
        background-image: none;
        background-color: #f5f5f5;
    }
}

/* Add a new general text style class that matches the visitors page styling */
.page-description {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    padding: 0 20px;
}

.subtitle {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #666;
    font-size: 18px;
    margin-top: 10px;
    text-align: center;
}

/* General text style for consistent font styling across all pages */
.text-content, p, .card-text, .description, .detail-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #333;
}

/* Styled text variations */
.text-italic {
    font-style: italic;
}

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

.text-muted {
    color: #666;
}

/* Mythical Creatures Database Styles */
.inspiration-link {
    display: block;
    text-align: center;
    margin-bottom: 20px;
    color: #9acd32;
    font-style: italic;
    text-decoration: none;
}

.inspiration-link:hover {
    text-decoration: underline;
}

.creature-card {
    background-color: #111;
    border-radius: 8px;
    margin: 30px auto;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-width: 800px;
    border: 1px solid #333;
    color: #eee;
}

.creatures-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.creatures-table th {
    background-color: #f2f2f2;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 10;
    color: #333;
}

.creatures-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

.creatures-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.creatures-table tr:hover {
    background-color: #f0f0f0;
}

.roll-dice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dice-icon {
    font-size: 14px;
}


