:root {
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #d4af37;
    /* Metallic Gold */
    --accent-hover: #f1c40f;
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Playfair Display', serif;
    --font-ui: 'Outfit', sans-serif;
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: #fff;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.highlight {
    color: var(--accent);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    height: var(--nav-height);
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Hero Section */
.hero {
    height: 60vh;
    background-image: url('https://images.unsplash.com/photo-1599577786435-08e08d1326c9?q=80&w=1920&auto=format&fit=crop');
    /* Placeholder image */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: var(--nav-height);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.3), var(--bg-dark));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #ddd;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* Breadcrumbs & Controls */
.breadcrumbs {
    margin: 40px 0 20px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.crumb {
    cursor: pointer;
}

.crumb:hover {
    color: var(--accent);
}

.crumb::after {
    content: '/';
    margin: 0 10px;
    color: #444;
}

.crumb:last-child {
    color: var(--text-main);
    cursor: default;
}

.crumb:last-child::after {
    content: '';
}

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.stats-badge {
    background: #222;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #333;
}

/* Main Section Layout */
.main-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
    min-height: 600px;
}

@media (max-width: 1024px) {
    .main-section {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 400px;
        position: relative;
        top: 0 !important;
        /* Disable sticky on mobile */
    }
}

/* Map */
.map-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    height: calc(100vh - 120px);
    position: sticky;
    top: 90px;
}

#map {
    width: 100%;
    height: 100%;
}

/* Castle Cards */
.castles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.castle-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.castle-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.card-img {
    height: 180px;
    width: 100%;
    object-fit: cover;
    background: #222;
}

.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.card-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.card-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.btn-icon {
    background: none;
    border: 1px solid #333;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

/* Footer */
.footer {
    border-top: 1px solid #222;
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: #050505;
}

/* Leaflet Customization */
.leaflet-popup-content-wrapper {
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 8px;
    border: 1px solid var(--accent);
}

.leaflet-popup-tip {
    background: var(--accent);
}

.leaflet-container a {
    color: var(--accent);
}