/* ===== ARS MAGICA SPELL DATABASE STYLES ===== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cinzel', serif, 'Times New Roman', serif;
    background: linear-gradient(135deg, #1a0e08 0%, #2c1810 50%, #1a0e08 100%);
    color: #f4f1e8;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(42, 26, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid #d4af37;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: #d4af37;
    text-decoration: none;
    transition: color 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.logo:hover {
    color: #e6d4b7;
}

.tagline {
    font-size: 0.9em;
    color: #b8941f;
    font-weight: 400;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: #f4f1e8;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
}

/* ===== MAIN CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

/* ===== HEADER SECTION ===== */
.header-section {
    text-align: center;
    margin-bottom: 50px;
    padding: 50px 20px;
    background: rgba(139, 115, 85, 0.15);
    border: 1px solid #8b7355;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #d4af37, #b8941f);
}

.header-section h1 {
    font-size: 3.2em;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.header-section p {
    font-size: 1.3em;
    color: #e6d4b7;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

/* ===== CONFIGURATION PANELS ===== */
.panel {
    background: rgba(139, 115, 85, 0.15);
    border: 1px solid #8b7355;
    border-radius: 16px;
    margin-bottom: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel:hover {
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.15);
}

.panel-header {
    padding: 25px 30px;
    background: rgba(139, 115, 85, 0.2);
    border-bottom: 1px solid #8b7355;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.panel-header:hover {
    background: rgba(139, 115, 85, 0.3);
    border-left: 4px solid #d4af37;
}

.panel-header.active {
    background: rgba(139, 115, 85, 0.3);
    border-left: 4px solid #d4af37;
}

.panel-icon {
    font-size: 1.2em;
    color: #d4af37;
    font-weight: 600;
}

.panel-title {
    flex: 1;
}

.panel-title h3 {
    color: #d4af37;
    font-size: 1.5em;
    margin-bottom: 5px;
    font-weight: 600;
}

.panel-title p {
    color: #e6d4b7;
    font-size: 1em;
    opacity: 0.9;
}

.panel-arrow {
    color: #d4af37;
    font-size: 1.3em;
    transition: transform 0.3s ease;
}

.panel-arrow.rotated {
    transform: rotate(180deg);
}

.panel-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.panel-content.expanded {
    max-height: 1000px;
    padding: 30px;
}

/* ===== FORM ELEMENTS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #ccc;
    font-weight: 500;
    font-size: 0.9em;
}

.form-group input, .form-group select {
    background: rgba(42, 26, 15, 0.7);
    border: 1px solid #8b7355;
    border-radius: 8px;
    padding: 12px 16px;
    color: #f4f1e8;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.search-box {
    background: rgba(42, 26, 15, 0.7);
    border: 1px solid #8b7355;
    border-radius: 12px;
    padding: 16px 20px;
    color: #f4f1e8;
    font-size: 1em;
    width: 100%;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* ===== BUTTONS ===== */
.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #1a0e08;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== STATUS INDICATORS ===== */
.status-indicator {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 15px;
}

.status-loading {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

.status-success {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
}

.status-error {
    background: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
}

/* ===== CALCULATOR GRID ===== */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.calc-result {
    background: rgba(42, 26, 15, 0.8);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.calc-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.calc-label {
    font-size: 0.8em;
    color: #ccc;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #d4af37;
}

/* ===== RESULTS SECTION ===== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.results-count {
    color: #ccc;
    font-size: 1.1em;
    font-weight: 500;
}

.sort-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.sort-label {
    color: #ccc;
    font-size: 0.9em;
    margin-right: 10px;
}

.sort-btn {
    background: rgba(139, 115, 85, 0.3);
    border: 1px solid #8b7355;
    border-radius: 6px;
    padding: 8px 16px;
    color: #f4f1e8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85em;
    font-weight: 500;
}

.sort-btn:hover, .sort-btn.active {
    background: rgba(212, 175, 55, 0.3);
    color: #d4af37;
    border-color: #d4af37;
}

/* ===== SPELL GRID ===== */
.spell-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 25px;
}

.spell-card {
    background: rgba(139, 115, 85, 0.1);
    border: 1px solid #8b7355;
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.spell-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.spell-card:hover::before {
    transform: scaleX(1);
}

.spell-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
}

.spell-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.spell-name {
    color: #d4af37;
    font-size: 1.4em;
    font-weight: 600;
    line-height: 1.3;
    flex: 1;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.spell-level {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #1a0e08;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 700;
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.spell-arts {
    color: #e6d4b7;
    font-size: 1.1em;
    margin-bottom: 20px;
    font-weight: 500;
}

.spell-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgba(42, 26, 15, 0.6);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #8b7355;
}

.stat-label {
    color: #ccc;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    color: #f4f1e8;
    font-weight: 600;
    font-size: 0.95em;
}

.spell-description {
    color: #e6d4b7;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.spell-guidelines {
    background: rgba(42, 26, 15, 0.6);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #d4af37;
    font-size: 0.9em;
    color: #ccc;
}

.guidelines-label {
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 8px;
}

/* ===== ERROR MESSAGES ===== */
.error-message {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff6b6b;
    border-radius: 12px;
    padding: 30px;
    color: #ff6b6b;
    text-align: center;
    margin: 30px 0;
}

.error-message h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* ===== CACHE INFO ===== */
.cache-info {
    font-size: 0.85em;
    color: #999;
    margin-top: 15px;
    text-align: center;
}

/* ===== LOADING SKELETON ===== */
.loading-skeleton {
    animation: shimmer 1.5s infinite;
    background: linear-gradient(90deg, rgba(139, 115, 85, 0.1) 25%, rgba(139, 115, 85, 0.3) 50%, rgba(139, 115, 85, 0.1) 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .container {
        padding: 100px 15px 40px;
    }
    
    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .calculator-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .header-section h1 {
        font-size: 2.8em;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(42, 26, 15, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.3);
        padding: 20px 0;
        gap: 10px;
        border-bottom: 2px solid #d4af37;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .header-section h1 {
        font-size: 2.2em;
    }
    
    .header-section p {
        font-size: 1.1em;
    }
    
    .panel-content.expanded {
        padding: 20px;
    }
    
    .spell-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .sort-controls {
        justify-content: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-section {
        padding: 30px 15px;
    }
    
    .header-section h1 {
        font-size: 1.8em;
    }
    
    .header-section p {
        font-size: 1em;
    }
    
    .panel-header {
        padding: 20px;
    }
    
    .panel-icon {
        font-size: 1em;
    }
    
    .panel-title h3 {
        font-size: 1.3em;
    }
    
    .spell-card {
        padding: 20px;
    }
    
    .spell-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .spell-level {
        align-self: flex-end;
    }
    
    .spell-stats {
        grid-template-columns: 1fr;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1.5em;
    }
    
    .tagline {
        font-size: 0.8em;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}