:root {
  --font-serif: 'Cormorant Garamond', serif;
  --font-body: 'Verdana', 'Segoe UI', Tahoma, Geneva, sans-serif;
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --bg-overlay: rgba(16, 20, 35, 0.85); 
  --text-color: #e0e0e0;
}

body {
    background-color: #0f172a;
    background-image: url('../Resources/Dream%20Interpreter/Interpreter%20Background.jpg');
    background-size: 100% 100%;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-color);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Custom Scrollbar to match Dream Interpreter */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: rgba(16, 20, 35, 0.9); 
}
::-webkit-scrollbar-thumb {
    background: #667eea; 
    border-radius: 6px;
    border: 3px solid rgba(16, 20, 35, 0.9);
}
::-webkit-scrollbar-thumb:hover {
    background: #764ba2; 
}


.title-container {
    text-align: center;
    padding: 2rem 0;
}

h1 {
    font-family: var(--font-serif);
    font-size: 3rem;
    color: #fff;
    text-shadow: 
        0 0 15px rgba(102, 126, 234, 1),
        0 0 30px rgba(102, 126, 234, 0.8),
        0 0 45px rgba(102, 126, 234, 0.6),
        2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
    margin-top: 3rem;
    text-align: center;
}

/* Back Button Style from Dream Interpreter */
.back-btn { 
    font-family: var(--font-body); 
    position: fixed; 
    top: 16px; 
    left: 16px; 
    z-index: 9999; 
    display: inline-block; 
    padding: 0.6rem 1rem; 
    font-size: 0.95rem; 
    background: linear-gradient(135deg, rgba(0,240,255,0.28), rgba(255,0,110,0.28)); 
    color: #00f0ff; 
    border: 2px solid rgba(0,240,255,0.6); 
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 700; 
    backdrop-filter: blur(8px); 
    text-shadow: 0 0 8px rgba(0,240,255,0.8); 
    box-shadow: 0 8px 28px rgba(0,240,255,0.25), 0 0 24px rgba(255,0,110,0.15); 
}

.back-btn:hover { 
    transform: translateY(-1px) scale(1.02); 
    box-shadow: 0 14px 36px rgba(0,240,255,0.35), 0 0 36px rgba(255,0,110,0.2); 
}

/* Consult Interpret Button - Matching style but positioned right */
.consult-btn {
    font-family: var(--font-body); 
    position: fixed; 
    top: 16px; 
    right: 16px; 
    z-index: 9999; 
    display: inline-block; 
    padding: 0.6rem 1rem; 
    font-size: 0.95rem; 
    /* Using a distinct but harmonious gradient - maybe purple/indigo */
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    color: #fff;
    border: 2px solid rgba(102, 126, 234, 0.6);
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 700; 
    backdrop-filter: blur(8px); 
    text-shadow: 0 0 8px rgba(102, 126, 234, 0.8); 
    box-shadow: 0 8px 28px rgba(102, 126, 234, 0.25), 0 0 24px rgba(118, 75, 162, 0.15);
    transition: all 0.3s ease;
}

.consult-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 14px 36px rgba(102, 126, 234, 0.35), 0 0 36px rgba(118, 75, 162, 0.2);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
}

/* Search Section */
.search-section {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
    padding: 0 1rem;
}

#symbolSearch {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #444;
    border-radius: 6px; /* Matching form input style */
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 1.1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

#symbolSearch:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Grid Layouts - Using Masonry Style via Columns */
.category-grid {
    column-count: 4;
    column-gap: 20px;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .category-grid {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .category-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .category-grid {
        column-count: 1;
    }
}


/* Card Styling - Matching Dream Interpreter .card */
.category-card {
    background: var(--bg-overlay);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: var(--text-color);
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;

    /* Masonry fix properties */
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

.meaning-card {
    /* Same as .card but ensuring it applies here too */
    background: var(--bg-overlay);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: var(--text-color);
    backdrop-filter: blur(5px);
    margin-bottom: 20px; /* Add spacing between stacked cards */
}


.category-card:hover, .meaning-card:hover { 
    /* Subtle lift effect isn't in original card, but nice for interactive elements */
     transform: translateY(-2px);
}


.category-title, .meaning-card h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem; /* Close to 2em */
    color: #fff;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    text-shadow: 
        0 0 10px rgba(102, 126, 234, 0.6),
        0 0 20px rgba(102, 126, 234, 0.4);
}

.symbol-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.symbol-link {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1); /* style like .btn-secondary */
    border: 1px solid #444;
    border-radius: 50px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: var(--font-serif);
    letter-spacing: 1px;
}

.symbol-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
}

.loading {
    text-align: center;
    font-size: 1.2rem;
    color: #cbd5e1;
    grid-column: 1 / -1;
    font-family: var(--font-serif);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(16, 20, 35, 0.95);
    border-radius: 10px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    border: 1px solid rgba(102, 126, 234, 0.3);
    display: none; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    display: block;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Symbol Detail Page Styles */
.symbol-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.symbol-title {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    /* Keeping the gradient text for the main title as it's distinct */
    background: linear-gradient(to right, #fff, #a3bffa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
    font-family: var(--font-serif);
}

.symbol-category {
    font-size: 1.2rem;
    color: #cbd5e1;
    font-family: var(--font-serif);
    font-style: italic;
    opacity: 0.8;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 1rem;
}

/* Special styling for primary meaning card if needed, 
   inherits from .meaning-card but with extra emphasis from Dream Interpreter .output style */
.meaning-card.primary {
    grid-column: 1 / -1;
    border-left: 4px solid #667eea; /* Like .output */
}

.meaning-text {
    line-height: 1.6;
    color: #eaeaea;
    font-size: 1.05rem;
    font-family: var(--font-body);
}

.variations-list {
    list-style-type: none;
    padding: 0;
}

.variations-list li {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #667eea; /* Matching .history-item */
    color: #ddd;
    font-size: 0.95rem;
}

.related-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    /* Styled like .btn-secondary or small badge */
    background: rgba(102, 126, 234, 0.2);
    color: #a3bffa;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

@media (max-width: 768px) {
    .category-grid, .content-grid {
        grid-template-columns: 1fr;
    }
    
    .symbol-title {
        font-size: 2.5rem;
    }
}
