/* Custom Styles for Rune Oracle */

:root {
    --purple-glow: rgba(168, 85, 247, 0.4);
    --pink-glow: rgba(236, 72, 153, 0.4);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.5) rgba(0, 0, 0, 0.3);
}

*::-webkit-scrollbar {
    width: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.7);
}

/* Rune Symbol in Header */
.rune-symbol {
    font-size: 2.5rem;
    font-family: 'Cinzel', serif;
    color: #c084fc;
    animation: float 3s ease-in-out infinite;
    text-shadow: 0 0 20px var(--purple-glow);
}

/* Custom Scrollbar for Modal Content */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.6) rgba(0, 0, 0, 0.4);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 10px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    margin: 10px 0;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c084fc 0%, #ec4899 100%);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.4);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a855f7 0%, #db2777 100%);
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #c084fc 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mystic Card */
.mystic-card {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.2) 0%, rgba(0, 0, 0, 0.4) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 1rem;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.1);
    transition: all 0.3s ease;
}

.mystic-card:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 12px 48px rgba(168, 85, 247, 0.2);
}

/* Navigation Buttons */
.nav-btn {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    border: 1px solid transparent;
}

.nav-btn.active {
    background: rgba(168, 85, 247, 0.3);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* Reading Type Buttons */
.reading-btn {
    position: relative;
    overflow: hidden;
}

.reading-btn.active {
    border-color: #c084fc;
    background: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.reading-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.reading-btn:hover::before {
    left: 100%;
}

/* Rune Card */
.rune-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(0, 0, 0, 0.5) 100%);
    border: 2px solid rgba(168, 85, 247, 0.4);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: runeReveal 0.8s ease-out forwards;
    opacity: 0;
    transform: rotateY(180deg) scale(0.8);
}

.rune-card.revealed {
    opacity: 1;
    transform: rotateY(0) scale(1);
}

.rune-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.4);
    border-color: #c084fc;
}

.rune-symbol-large {
    font-size: 5rem;
    font-family: 'Cinzel', serif;
    color: #c084fc;
    text-shadow: 0 0 30px var(--purple-glow), 0 0 60px var(--pink-glow);
    animation: glow 2s ease-in-out infinite alternate;
    display: block;
    margin: 1rem 0;
}

.rune-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #e9d5ff;
}

.rune-meaning {
    color: #d8b4fe;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.rune-description {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Rune Selection Grid */
.rune-selection-grid {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.5) rgba(0, 0, 0, 0.3);
}

.rune-select-btn {
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.5rem;
    font-size: 1.8rem;
    font-family: 'Cinzel', serif;
    color: #c084fc;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rune-select-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: #c084fc;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.rune-select-btn.selected {
    background: rgba(168, 85, 247, 0.4);
    border-color: #e879f9;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.6);
}

/* Selected Rune Badge */
.selected-rune-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(168, 85, 247, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-family: 'Cinzel', serif;
    color: #e9d5ff;
    animation: badgeAppear 0.3s ease-out;
}

.selected-rune-badge button {
    color: #f472b6;
    font-size: 1rem;
    transition: all 0.2s;
}

.selected-rune-badge button:hover {
    color: #ec4899;
    transform: scale(1.2);
}

/* Prose Styling for Interpretation */
.prose {
    color: #e2e8f0;
}

.prose h3 {
    color: #c084fc;
    font-family: 'Cinzel', serif;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.prose strong {
    color: #e879f9;
}

.prose ul, .prose ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px var(--purple-glow), 0 0 40px var(--pink-glow);
    }
    to {
        text-shadow: 0 0 30px var(--purple-glow), 0 0 60px var(--pink-glow), 0 0 80px rgba(168, 85, 247, 0.2);
    }
}

@keyframes runeReveal {
    0% {
        opacity: 0;
        transform: rotateY(180deg) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: rotateY(0) scale(1);
    }
}

@keyframes badgeAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(168, 85, 247, 0.3);
    border-radius: 50%;
    border-top-color: #c084fc;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .rune-symbol-large {
        font-size: 3.5rem;
    }
    
    .mystic-card {
        padding: 1.5rem;
    }
    
    .rune-selection-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Canvas Container */
#bindrune-canvas-container {
    position: relative;
}

#bindrune-canvas {
    cursor: crosshair;
    touch-action: none;
}

/* Category Cards */
.category-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.category-card:hover::before {
    left: 100%;
}

.category-card:active {
    transform: scale(0.98);
}

/* Subcategory Cards */
.subcategory-card {
    cursor: pointer;
    position: relative;
}

.subcategory-card:hover {
    transform: translateX(5px);
}

.subcategory-card:active {
    transform: scale(0.98) translateX(5px);
}

/* Context Option */
.context-option {
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.context-option:hover {
    transform: translateX(5px);
}

.context-option:active {
    transform: scale(0.98);
}

/* Bindrune Mode Buttons */
.bindrune-mode-btn {
    cursor: pointer;
    position: relative;
}

.bindrune-mode-btn.active {
    border-color: #c084fc;
    background: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.bindrune-mode-btn:active {
    transform: scale(0.98);
}

/* Fade in animation */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

/* Utility Classes */
.section-content {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SVG Icon Animations */
.nav-btn svg {
    transition: all 0.3s ease;
}

.nav-btn:hover svg {
    transform: scale(1.1) rotate(5deg);
}

.nav-btn.active svg {
    filter: drop-shadow(0 0 8px currentColor);
}

/* Rune Particle Glow */
@keyframes runeGlow {
    0%, 100% {
        text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
        opacity: 0.3;
    }
    50% {
        text-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 0 60px currentColor;
        opacity: 0.6;
    }
}

.rune-particle {
    animation: runeGlow 3s ease-in-out infinite;
}

/* Shape Rotation */
@keyframes shapeRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shape Pulse */
@keyframes shapePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.2;
    }
}

/* Icon Sparkle Animation */
@keyframes iconSparkle {
    0%, 100% {
        filter: drop-shadow(0 0 2px currentColor);
    }
    50% {
        filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 12px currentColor);
    }
}

svg.animate-pulse {
    animation: iconSparkle 2s ease-in-out infinite;
}

/* Hover Effects for SVG Icons */
button svg, a svg {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover svg, a:hover svg {
    transform: translateY(-2px) scale(1.05);
}

button:active svg, a:active svg {
    transform: translateY(0) scale(0.95);
}

/* Mystical Float Animation for Header Rune */
@keyframes mysticalFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        filter: drop-shadow(0 0 10px currentColor);
    }
    25% {
        transform: translateY(-5px) rotate(2deg);
        filter: drop-shadow(0 0 15px currentColor);
    }
    50% {
        transform: translateY(-10px) rotate(0deg);
        filter: drop-shadow(0 0 20px currentColor);
    }
    75% {
        transform: translateY(-5px) rotate(-2deg);
        filter: drop-shadow(0 0 15px currentColor);
    }
}

.rune-symbol.animate-pulse {
    animation: mysticalFloat 4s ease-in-out infinite;
}