/* --- Variables & Reset --- */
:root {
    --bg-color: #f5f5f5;
    --surface: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --accent: #000000;
    --border: #e0e0e0;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --bg-color: #0a0a0a;
    --surface: #141414;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent: #ffffff;
    --border: #262626;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* --- Layout --- */
.nav-container, .hero, .dictionary, .contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 90px;
    display: flex;
    align-items: center;
    background: rgba(var(--bg-color), 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0px;
    text-decoration: none;
    color: var(--text-main);
}

.logo img {
    padding-top: 5px;
    height: 80px; /* Optional: Forces a specific vertical height */
    width: auto;  /* !!!არ გააფუჭო ეს!!! Keeps aspect ratio */
}


.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-select {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.lang-select:hover {
    background: var(--text-main);
    color: var(--bg-color);
}

#theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 50%;
}

/* --- Hero --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
} 

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 200;
    margin-bottom: 2rem;
    letter-spacing: -2px; 
}

.mission-statement {
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.scroll-indicator {
    margin-top: 4rem;
    font-size: 2rem;
    animation: bounce 2s infinite;
}

/* --- Dictionary Section --- */
.dictionary {
    padding-top: 100px;
    padding-bottom: 100px;
}

.section-header {
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

#search-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 20px;
    color: var(--text-main);
    width: 300px;
    outline: none;
}

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

.filter-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--accent);
    color: var(--bg-color);
}

/* --- Dictionary Grid Layouts --- */
.symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* DEFAULT GRID VIEW */
    gap: 2rem;
    width: 100%;
}

/* LIST VIEW STYLES (Applied via JS Toggle) */
.symbols-grid.list-view {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-x: auto; /* Allows horizontal scrolling on mobile for long lists */
}

/* Adjust Card Width for List View if needed, 
   otherwise cards stay full width by default. */
.symbols-grid.list-view .symbol-card {
    max-width: 100%;
    max-height: 200px;
    margin-bottom: 2rem;
}

.symbols-grid.list-view .card-img {
    height:0px; /* Make images taller in list view for better visual balance */
    aspect-ratio: auto;
    object-fit: cover;
    filter: grayscale(0); /* Optional: remove grayscale for lists */
}

/* Adjust Tags in List View if they feel cramped */
.symbols-grid.list-view .tag-container {
    display: flex;
    flex-wrap: wrap;
}

.btn-view-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-view-toggle:hover {
    background: var(--text-main);
    color: var(--bg-color);
}


.symbol-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.symbol-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.symbol-card:hover {
    transform: translateY(-10px);
    border-color: var(--text-muted);
}

.card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #000;
    margin-bottom: 1.5rem;
    filter: grayscale(1);
}

.symbol-card h3 {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.symbol-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 2rem;
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    position: relative;
    overflow-y: auto;
    padding: 3rem;
    border: 1px solid var(--border);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.modal-images label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.modal-images img {
    width: 100%;
    border: 1px solid var(--border);
    filter: grayscale(1);
    margin-bottom: 2rem;
}

.tag-container {
    margin-bottom: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--border);
    font-size: 0.75rem;
    margin: 0.1rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* --- Contact --- */
.contact {
    padding: 100px 0;
    border-top: 1px solid var(--border);
}

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    margin-top: 3rem;
}

.contact-link {
    display: block;
    color: var(--text-main);
    font-size: 1.5rem;
    text-decoration: none;
    margin-bottom: 1rem;
}

.social-links a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

footer {
    padding: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* --- Animations --- */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .modal-body { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
    .navbar .nav-links { display: none; }
    #search-bar { width: 100%; }
}

/* --- Map & Pin Styles --- */
.map-img-wrapper, .main-img-wrapper {
    position: relative; /* Important for absolute positioning pins */
    width: 100%;
}

/* ADD THIS - Make them stack vertically instead of side-by-side */
.modal-images {
    display: flex;
    flex-direction: column; /* This stacks items vertically */
    gap: 2rem;
}


#modal-map {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    display: block;
}

/* The Pins Container Wrapper inside Modal */
.pins-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicking through to the modal */
    z-index: 5; /* Sits on top of map image */
}

.pin-marker-wrapper {
    position: absolute;
    cursor: help; /* Optional: indicates interactivity */
}

/* Style for the Pin Icon */
.pin-marker-wrapper > svg {
    width: 12px;
    height: 12px;
    fill: #ff0000; /* Bright red is often used for map pins/
}

/* Optional: Add a shadow or halo to make the pin pop against the map */
.pin-marker-wrapper > svg path {
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5)); 
}

/*
.pin-marker-wrapper > svg path {
    fill: #000; /* Change from red (#ff0000) to black (#000) remove incase I want the pin to be black */
}

.citations-container {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ccc; /* Or your theme's accent color */
    font-size: 0.85rem;         /* Smaller than description text */
    color: var(--text-secondary, #aaa); /* Dark grey for citations */
    white-space: pre-wrap;       /* Preserves line breaks in JSON strings */
}

.citation-block {
    line-height: 1.4;
}
