/* Alchemical Symbols - Dedicated Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(135deg, #faf8f5 0%, #f5f2ed 50%, #f0ede6 100%);
    color: #2c2416;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #b8860b, transparent),
        radial-gradient(2px 2px at 40px 70px, #cd853f, transparent),
        radial-gradient(1px 1px at 90px 40px, #daa520, transparent),
        radial-gradient(1px 1px at 130px 80px, #d2691e, transparent),
        radial-gradient(2px 2px at 160px 30px, #cd853f, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 20s linear infinite;
    opacity: 0.15;
    z-index: -1;
}

@keyframes sparkle {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-100px); }
}

/* Header */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f6f1 100%);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #cd853f;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(205, 133, 63, 0.2);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-image {
    height: 40px;
    filter: drop-shadow(0 0 10px #cd853f);
}

.nav-button-container {
    display: flex;
    gap: 1rem;
}

.nav-button {
    background: linear-gradient(135deg, #cd853f, #a0522d);
    color: #ffffff;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-button:hover {
    background: linear-gradient(135deg, #d2691e, #cd853f);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(205, 133, 63, 0.3);
    border-color: #d2691e;
}

/* Symbol Board Controls */
.symbol-board-controls {    background: linear-gradient(135deg, #ffffff, #f8f6f1);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 20px;
    border: 2px solid #cd853f;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.textarea-container {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.symbol-board-textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #cd853f;
    border-radius: 15px;
    color: #2c2416;
    font-size: 1.2rem;
    padding: 1rem;
    min-height: 80px;
    resize: vertical;
    font-family: 'Georgia', serif;
    transition: all 0.3s ease;
}

.symbol-board-textarea:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(205, 133, 63, 0.3);
    border-color: #d2691e;
}

.textarea-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.button {
    background: linear-gradient(135deg, #cd853f, #a0522d);
    color: #ffffff;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.button:hover {
    background: linear-gradient(135deg, #d2691e, #cd853f);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(205, 133, 63, 0.3);
}

/* Main Content */
.page-layout-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 3rem;
    margin: 2rem 0;
}

.main-content-area {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 246, 241, 0.95));
    border-radius: 25px;
    padding: 3rem;
    border: 2px solid #cd853f;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 2.5rem;
    color: #8b4513;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(139, 69, 19, 0.3);
    font-weight: bold;
}

.section-description {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #2c2416;
    line-height: 1.6;
}

/* Symbols Container */
.symbols-container {
    margin: 2rem 0;
}

.symbols-title {
    font-size: 2rem;
    color: #a0522d;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 0 15px rgba(160, 82, 45, 0.3);
}

.category-header {
    background: linear-gradient(135deg, #f8f6f1, #f0ede6);
    color: #8b4513;
    padding: 1rem 2rem;
    margin: 2rem 0 1rem 0;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: bold;
    border-left: 5px solid #cd853f;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-shadow: 0 0 10px rgba(139, 69, 19, 0.2);
}

.symbols {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(248, 246, 241, 0.8));
    border-radius: 15px;
    border: 1px solid rgba(205, 133, 63, 0.3);
}

.symbol {
    background: linear-gradient(135deg, #ffffff, #f8f6f1);
    color: #8b4513;
    font-size: 2rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.symbol::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(205, 133, 63, 0.2), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.symbol:hover::before {
    opacity: 1;
    animation: shimmer 0.8s ease-in-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.symbol:hover {
    background: linear-gradient(135deg, #cd853f, #a0522d);
    color: #ffffff;
    transform: translateY(-5px) scale(1.1);
    border-color: #d2691e;
    box-shadow: 0 15px 30px rgba(205, 133, 63, 0.3);
    z-index: 10;
}

/* About Box */
.about-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 246, 241, 0.95));
    border-radius: 20px;
    padding: 2rem;
    margin: 3rem 0;
    border: 2px solid #cd853f;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-box h3 {
    color: #8b4513;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(139, 69, 19, 0.3);
}

.about-box h4 {
    color: #a0522d;
    font-size: 1.3rem;
    margin: 2rem 0 1rem 0;
    text-shadow: 0 0 10px rgba(160, 82, 45, 0.2);
}

.about-box p {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #2c2416;
}

/* Reference Table */
.reference-table {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.reference-table table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(135deg, #ffffff, #f8f6f1);
    border-radius: 15px;
    overflow: hidden;
}

.reference-table th {
    background: linear-gradient(135deg, #cd853f, #a0522d);
    color: #ffffff;
    padding: 1rem;
    font-weight: bold;
    text-align: center;
    border: none;
}

.reference-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(205, 133, 63, 0.2);
    color: #2c2416;
}

.reference-table td:first-child {
    font-size: 1.5rem;
    color: #8b4513;
}

.reference-table tr:nth-child(even) {
    background: rgba(205, 133, 63, 0.05);
}

.reference-table tr:hover {
    background: rgba(205, 133, 63, 0.1);
}

/* Grids */
.applications-grid,
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.grid-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 246, 241, 0.9));
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid rgba(205, 133, 63, 0.3);
    transition: all 0.3s ease;
}

.grid-item:hover {
    border-color: #cd853f;
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(205, 133, 63, 0.2);
}

.grid-item h5 {
    color: #8b4513;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid-item ul {
    list-style: none;
    padding: 0;
}

.grid-item li {
    margin: 0.5rem 0;
    padding-left: 1rem;
    position: relative;
    color: #2c2416;
}

.grid-item li::before {
    content: '⚗';
    position: absolute;
    left: 0;
    color: #cd853f;
}

/* Statistics Box */
.stats-box {
    background: linear-gradient(135deg, #cd853f, #a0522d);
    color: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 15px 40px rgba(205, 133, 63, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 246, 241, 0.95));
    border-radius: 20px;
    padding: 2.5rem;
    border: 2px solid #cd853f;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar h3 {
    color: #8b4513;
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 15px rgba(139, 69, 19, 0.3);
}

.featured-section {
    background: linear-gradient(135deg, rgba(205, 133, 63, 0.1), rgba(160, 82, 45, 0.1));
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(205, 133, 63, 0.3);
}

.featured-section h4 {
    color: #a0522d;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.sidebar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.sidebar-grid-single {
    display: grid;
    gap: 0.5rem;
}

.symbol-category {
    transition: all 0.3s ease;
}

.symbol-category a {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 246, 241, 0.9));
    color: #2c2416;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid rgba(205, 133, 63, 0.2);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.symbol-category a:hover {
    background: linear-gradient(135deg, #cd853f, #a0522d);
    color: #ffffff;
    transform: translateX(5px);
    border-color: #d2691e;
    box-shadow: 0 5px 15px rgba(205, 133, 63, 0.3);
}

.current-page {
    background: linear-gradient(135deg, #cd853f, #a0522d) !important;
    color: #ffffff !important;
    font-weight: bold;
}

.all-categories {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cd853f transparent;
}

.all-categories::-webkit-scrollbar {
    width: 6px;
}

.all-categories::-webkit-scrollbar-track {
    background: transparent;
}

.all-categories::-webkit-scrollbar-thumb {
    background: #cd853f;
    border-radius: 3px;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #f8f6f1, #f0ede6);
    color: #2c2416;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 2px solid #cd853f;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-nav {
    display: flex;
    gap: 2rem;
}

.footer-link {
    color: #a0522d;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #8b4513;
    text-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #cd853f, #a0522d);
    color: #ffffff;
    padding: 2rem 3rem;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 20px 50px rgba(205, 133, 63, 0.4);
    border: 3px solid #d2691e;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.copy-notification.show {
    transform: translate(-50%, -50%) scale(1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-layout-container {
        grid-template-columns: 1fr 350px;
        gap: 2rem;
    }
    
    .container {
        max-width: 1200px;
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .page-layout-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
        position: static;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .textarea-container {
        flex-direction: column;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .symbols {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .symbol {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .applications-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .main-content-area {
        padding: 1.5rem;
    }
    
    .symbols {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 0.5rem;
    }
    
    .symbol {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category fade-in animation */
.symbols-section {
    animation: fadeInUp 0.6s ease forwards;
}

.symbols-section:nth-child(odd) {
    animation-delay: 0.1s;
}

.symbols-section:nth-child(even) {
    animation-delay: 0.2s;
}

/* ===== ENHANCED INTERACTIVE ELEMENTS ===== */

/* Mystical Search */
.mystical-search-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    position: sticky;
    top: 100px;
    z-index: 100;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

#mystical-search {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 246, 241, 0.95));
    border: 2px solid #cd853f;
    border-radius: 50px;
    color: #2c2416;
    font-size: 1rem;
    font-family: inherit;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(205, 133, 63, 0.2);
    transition: all 0.3s ease;
}

#mystical-search:focus {
    outline: none;
    border-color: #d2691e;
    box-shadow: 0 8px 32px rgba(210, 105, 30, 0.3);
    transform: translateY(-2px);
}

#mystical-search::placeholder {
    color: #888;
    font-style: italic;
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #cd853f;
    pointer-events: none;
}

/* Mystical Notifications */
.mystical-notification {
    position: fixed;
    top: 120px;
    right: 2rem;
    background: linear-gradient(135deg, #cd853f, #d2691e);
    color: #ffffff;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(205, 133, 63, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10000;
    font-weight: 600;
    max-width: 300px;
}

.mystical-notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-icon {
    font-size: 1.2rem;
}

/* Copy Effects */
.copied-glow {
    background: linear-gradient(45deg, #d2691e, #cd853f) !important;
    color: #ffffff !important;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.mystical-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: rippleEffect 1s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Magical Particles */
.magical-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ffd700, transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    transition: all 1s ease-out;
}

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-up.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Sidebar */
.sidebar-toggle {
    display: none;
    background: linear-gradient(135deg, #cd853f, #d2691e);
    border: none;
    color: #ffffff;
    padding: 0.8rem;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    box-shadow: 0 4px 16px rgba(205, 133, 63, 0.3);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(205, 133, 63, 0.5);
}

/* Loading States */
.loaded .fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Parallax Elements */
.parallax-element {
    transition: transform 0.1s ease-out;
}

/* Enhanced Hover Effects */
.symbol-card:hover .symbol {
    animation: symbolPulse 0.6s ease;
}

@keyframes symbolPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Theme System Foundation */
[data-theme="dark"] {
    --primary-bg: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    --accent-color: #daa520;
    --text-color: #e0e0e0;
}

[data-theme="light"] {
    --primary-bg: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 50%, #d3d3d3 100%);
    --accent-color: #8b4513;
    --text-color: #333;
}

/* Performance Optimizations */
.symbol-card,
.symbol {
    will-change: transform;
}

.mystical-notification,
.magical-particle {
    will-change: transform, opacity;
}

/* ===== RESPONSIVE ENHANCEMENTS ===== */

@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    
    .sidebar-active {
        overflow: hidden;
    }
    
    .mystical-search-container {
        position: static;
        margin: 1rem;
    }
    
    .mystical-notification {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    /* Disable parallax on mobile for performance */
    .parallax-element {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    #mystical-search {
        padding: 0.8rem 2.5rem 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .search-icon {
        right: 1rem;
        font-size: 1rem;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .parallax-element {
        transform: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .symbol-card {
        border: 2px solid #fff;
    }
    
    .symbol {
        color: #fff;
        background: #000;
    }
}

/* Print Styles */
@media print {
    body::before,
    .mystical-search-container,
    .sidebar-toggle,
    .mystical-notification {
        display: none !important;
    }
    
    .symbol-card {
        break-inside: avoid;
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
    }
}
