/* Arthurian Legend Theme - Color Variables */
:root {
    --royal-blue: #1a3a6e;      /* Deep royal blue */
    --gold: #c9a227;            /* Rich gold */
    --deep-red: #8b0000;        /* Blood red */
    --forest-green: #2c5530;    /* Forest green */
    --parchment: #f5e9d0;       /* Parchment background */
    --dark-parchment: #e8d6b3;  /* Darker parchment for contrast */
    --stone-gray: #5a5a5a;      /* Stone gray for text */
    --dark-wood: #3e2723;       /* Dark wood brown */
    --light-wood: #8d6e63;      /* Light wood brown */
    --highlight-gold: #ffd700;  /* Bright gold for highlights */
}

html {
    touch-action: manipulation; /* Improve touch responsiveness globally */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--parchment);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%23e8d6b3" stroke-width="0.5" stroke-opacity="0.3"/></svg>');
    color: var(--stone-gray);
}

/* Disable text selection on interactive elements to improve mobile touch experience */
.tab, .knight-card, #modal-close-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Decorative initial capital letter for paragraphs */
.content-section > p:first-of-type::first-letter {
    font-family: 'MedievalSharp', cursive;
    font-size: 2.5em;
    float: left;
    line-height: 1;
    margin-right: 0.2em;
    padding-top: 0.1em;
    color: var(--deep-red);
}

/* Override for centered text to ensure proper alignment */
.content-section > p.text-center:first-of-type::first-letter {
    float: none;
    margin-right: 0;
    padding-top: 0;
}

.tab {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(201, 162, 39, 0.2); /* Light gold highlight for taps */
    touch-action: manipulation; /* Improves touch responsiveness */
    min-height: 44px; /* Minimum touch target size */
    min-width: 44px; /* Minimum touch target size */
    padding: 8px 12px; /* Ensure enough padding for touch */
    font-family: 'MedievalSharp', cursive;
    color: var(--royal-blue);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab.active {
    border-color: var(--gold);
    color: var(--deep-red);
    font-weight: 600;
}

.tab.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background-color: var(--gold);
    border-radius: 50%;
}

/* Add visual feedback for touch on mobile */
.tab:active, .tab:hover {
    background-color: rgba(201, 162, 39, 0.1); /* Light gold background for active state */
}
/* Add decorative border to main container */
main .container {
    position: relative;
}

main .bg-white {
    background-color: var(--parchment) !important;
    border: 8px solid var(--dark-wood);
    border-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect x="10" y="10" width="80" height="80" fill="none" stroke="%233e2723" stroke-width="10" rx="15" ry="15"/></svg>') 20 stretch;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Decorative dividers */
.content-section h3 {
    position: relative;
    color: var(--royal-blue);
    font-family: 'MedievalSharp', cursive;
}

.content-section h3.text-indigo-600 {
    color: var(--royal-blue) !important;
    border-bottom: 2px solid var(--gold) !important;
}

/* Knight cards with medieval styling */
.knight-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    min-height: 120px; /* Ensure minimum touch target size */
    -webkit-tap-highlight-color: rgba(201, 162, 39, 0.2); /* Light gold highlight for taps */
    touch-action: manipulation; /* Improves touch responsiveness */
    background-color: var(--dark-parchment) !important;
    border: 2px solid var(--light-wood) !important;
    position: relative;
    overflow: hidden;
}

.knight-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--gold), var(--deep-red), var(--gold));
}

.knight-card:hover, .knight-card:active {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(62, 39, 35, 0.3), 0 4px 6px -4px rgba(62, 39, 35, 0.2);
    border-color: var(--gold) !important;
}
/* Modal with medieval styling */
.modal {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.flex {
    display: flex;
}

.modal .bg-white {
    background-color: var(--parchment) !important;
    border: 8px solid var(--dark-wood);
    border-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect x="10" y="10" width="80" height="80" fill="none" stroke="%233e2723" stroke-width="10" rx="15" ry="15"/></svg>') 20 stretch;
}

/* Improve modal close button for mobile */
#modal-close-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(201, 162, 39, 0.2);
    touch-action: manipulation;
    color: var(--deep-red);
    font-size: 2rem;
}

/* Timeline with medieval styling */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 2rem; /* Position at the top of the header instead of middle */
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--dark-parchment);
    border: 4px solid var(--gold);
    z-index: 10; /* Ensure it's above other elements */
    box-shadow: 0 0 0 2px var(--royal-blue);
}

.timeline-line {
    position: absolute;
    left: -21px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--royal-blue);
}

/* Quest Stage Accordion Styles with medieval theme */
.quest-stage-header {
    transition: all 0.3s ease;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border-radius: 0.5rem;
    background-color: var(--dark-parchment);
    border: 2px solid var(--light-wood);
    position: relative;
    overflow: hidden;
    font-family: 'MedievalSharp', cursive;
    color: var(--royal-blue);
}

.quest-stage-header::before {
    content: "⚔️";
    position: absolute;
    left: 0.5rem;
    opacity: 0.2;
    font-size: 1.5rem;
}

.quest-stage-header:hover {
    background-color: var(--parchment);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(62, 39, 35, 0.3), 0 2px 4px -1px rgba(62, 39, 35, 0.2);
    border-color: var(--gold);
}

.quest-stage-content {
    padding: 0.75rem;
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    background-color: var(--parchment);
    border: 2px solid var(--light-wood);
    transition: all 0.3s ease;
    position: relative;
}

.quest-stage-content::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.5;
}

.quest-stage-content.hidden {
    display: none;
}

.accordion-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.area-item {
    margin-bottom: 1rem;
}

.area-item:last-child {
    margin-bottom: 0;
}
.chart-container {
    position: relative; 
    width: 100%; 
    max-width: 400px; 
    margin-left: auto; 
    margin-right: auto; 
    height: 300px;
    max-height: 350px;
}

/* Music Player Styles with medieval theme */
#music-player {
    background-color: var(--parchment);
    border: 2px solid var(--light-wood);
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

#music-player::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--gold), var(--deep-red), var(--gold));
    opacity: 0.7;
}

#playlist {
    background-color: var(--parchment) !important;
    border: 2px solid var(--light-wood) !important;
    max-height: 200px;
    overflow-y: auto;
}

#playlist .playlist-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: rgba(201, 162, 39, 0.2);
    touch-action: manipulation;
    min-height: 44px;
    border-bottom: 1px solid var(--dark-parchment);
    font-family: 'MedievalSharp', cursive;
    position: relative;
}

#playlist .playlist-item:hover {
    background-color: var(--dark-parchment);
}

#playlist .playlist-item.active {
    background-color: rgba(201, 162, 39, 0.2);
    color: var(--deep-red);
    font-weight: 600;
    padding-left: 24px;
}

#playlist .playlist-item.active::before {
    content: "♫";
    position: absolute;
    left: 5px;
    color: var(--gold);
}

#progress-bar {
    transition: width 0.1s linear;
    background-color: var(--gold) !important;
}

#play-pause-button, #prev-button, #next-button {
    transition: transform 0.1s;
    -webkit-tap-highlight-color: rgba(201, 162, 39, 0.2);
    touch-action: manipulation;
}

#play-pause-button {
    background-color: var(--royal-blue) !important;
}

#prev-button, #next-button {
    background-color: rgba(201, 162, 39, 0.2) !important;
    color: var(--royal-blue) !important;
}

#play-pause-button:active, #prev-button:active, #next-button:active {
    transform: scale(0.95);
}

/* Album Art Styles */
#album-art {
    transition: all 0.3s ease;
    background-color: var(--dark-parchment);
    border: 3px solid var(--light-wood);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

#album-art::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%23c9a227" stroke-width="0.5" stroke-opacity="0.2"/></svg>');
    pointer-events: none;
}

#album-art-container {
    margin: 1rem 0;
}

/* Talent Tree Styles with medieval theme */
.talent-tree {
    position: relative;
    min-height: 100%;
    background-color: var(--parchment);
    border: 2px solid var(--light-wood);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.talent-tree-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
}

.talent-tree-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    color: var(--deep-red);
}

.talent-tree-title {
    font-weight: bold;
    font-size: 1.1rem;
    font-family: 'MedievalSharp', cursive;
    color: var(--royal-blue);
}

.talent-tree-identity {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: var(--stone-gray);
    font-style: italic;
    border-left: 3px solid var(--gold);
    padding-left: 0.5rem;
}

.talent-tree-tiers {
    position: relative;
}

.talent-tree-tier {
    margin-bottom: 1.5rem;
    position: relative;
}

.tier-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-family: 'MedievalSharp', cursive;
    color: var(--forest-green);
}

.tier-connector {
    position: relative;
    display: block;
    margin: 10px auto;
    width: 2px;
    height: 20px;
    background-color: var(--gold);
    z-index: 0;
}

.tier-connector::before, .tier-connector::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--gold);
    border-radius: 50%;
    left: -2px;
}

.tier-connector::before {
    top: -3px;
}

.tier-connector::after {
    bottom: -3px;
}

.ability-card {
    position: relative;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    z-index: 1;
    background-color: var(--dark-parchment);
    border: 1px solid var(--light-wood);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ability-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(62, 39, 35, 0.3), 0 2px 4px -1px rgba(62, 39, 35, 0.2);
    border-color: var(--gold);
}

.ability-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid rgba(201, 162, 39, 0.3);
    padding-bottom: 0.25rem;
}

.ability-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    text-align: center;
    color: var(--deep-red);
    background-color: rgba(201, 162, 39, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ability-name {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    font-family: 'MedievalSharp', cursive;
    color: var(--royal-blue);
}

.ability-type {
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 0.25rem;
    color: var(--forest-green);
    border-left: 2px solid var(--gold);
    padding-left: 0.5rem;
}

.ability-description {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--stone-gray);
    background-color: rgba(245, 233, 208, 0.5);
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.choose-one-label {
    text-align: center;
    font-size: 0.8rem;
    font-style: italic;
    margin: 0.5rem 0;
    color: var(--deep-red);
    position: relative;
}

.choose-one-label::before,
.choose-one-label::after {
    content: "✧";
    color: var(--gold);
    margin: 0 0.5rem;
}

/* Responsive adjustments for talent trees */
@media (max-width: 768px) {
    #talent-trees {
        display: block;
    }

    .talent-tree {
        margin-bottom: 2rem;
    }

    .talent-tree-toggle-btn {
        display: block;
        width: 100%;
        padding: 0.75rem;
        text-align: left;
        border: none;
        background: none;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .talent-tree-content {
        max-height: none; /* Show all content by default */
        overflow: visible;
        transition: max-height 0.3s ease;
    }

    /* If we still want to use the toggle functionality, we can use this class */
    .talent-tree-content.collapsed {
        max-height: 0;
        overflow: hidden;
    }

    .talent-tree-content.expanded {
        max-height: 2000px; /* Large enough to contain content */
    }
}

/* Desktop view for talent trees */
@media (min-width: 769px) {
    .talent-tree-toggle-btn {
        display: none;
    }

    .talent-tree-content {
        max-height: none !important;
        overflow: visible;
    }
}

/* Roadmap section with medieval styling */
#roadmap .border-l-4.border-indigo-500 {
    border-left-color: var(--gold) !important;
    background-color: var(--parchment) !important;
    position: relative;
    overflow: hidden;
}

#roadmap .border-l-4.border-indigo-500::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%23c9a227" stroke-width="0.5" stroke-opacity="0.1"/></svg>');
    pointer-events: none;
}

#roadmap .text-lg.font-bold.text-indigo-700 {
    color: var(--royal-blue) !important;
    font-family: 'MedievalSharp', cursive;
}

/* General text color overrides */
.text-slate-500, .text-slate-600, .text-slate-700, .text-slate-800 {
    color: var(--stone-gray) !important;
}

.text-indigo-600 {
    color: var(--royal-blue) !important;
}

/* Background color overrides */
.bg-slate-50, .bg-slate-100, .bg-white {
    background-color: var(--parchment) !important;
}

.bg-indigo-100 {
    background-color: rgba(201, 162, 39, 0.2) !important;
}

.bg-indigo-600 {
    background-color: var(--royal-blue) !important;
}

/* Border color overrides */
.border-slate-200, .border-slate-300 {
    border-color: var(--light-wood) !important;
}

/* Add decorative scroll to the top of the page */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: url('data:image/svg+xml;utf8,<svg width="100" height="15" xmlns="http://www.w3.org/2000/svg"><path d="M0,0 C25,15 75,15 100,0" fill="none" stroke="%23c9a227" stroke-width="2"/></svg>');
    background-repeat: repeat-x;
    z-index: 1000;
    pointer-events: none;
}

/* Add decorative scroll to the bottom of the page */
body::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: url('data:image/svg+xml;utf8,<svg width="100" height="15" xmlns="http://www.w3.org/2000/svg"><path d="M0,15 C25,0 75,0 100,15" fill="none" stroke="%23c9a227" stroke-width="2"/></svg>');
    background-repeat: repeat-x;
    z-index: 1000;
    pointer-events: none;
}
