/* ==========================================================================
   Kurpielovci.eu Luxury Dark Theme Stylesheet
   Background: #0B0C10 | Card: #1F2833 | Gold: #D4AF37 / #FFD700
   ========================================================================== */

:root {
    --bg-main: #0B0C10;
    --bg-card: #1F2833;
    --bg-darker: #12161D;
    --text-main: #E0E0E0;
    --text-muted: #C5C6C7;
    --gold: #D4AF37;
    --gold-bright: #FFD700;
    --gold-dim: #997A15;
    --border-dark: #2C3531;
    --border-gold: rgba(212, 175, 55, 0.3);
    --danger: #e74c3c;
    --success: #2ecc71;
    --font-heading: 'Cinzel', serif, Georgia;
    --font-body: 'Montserrat', sans-serif, system-ui;
    --radius-sm: 2px;
    --radius-md: 2px;
    --radius-lg: 2px;
    --shadow-luxury: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1 0 auto;
}

/* Spacing Utility Classes */
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-5 { padding-top: 3rem; }
.pb-5 { padding-bottom: 3rem; }
.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-5 { margin-top: 3rem; margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

/* Headings & Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: #FFFFFF;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--gold-bright);
}

.gold-text {
    color: var(--gold) !important;
}

.gold-link {
    color: var(--gold);
    font-weight: 600;
}

.gold-link:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.font-bold {
    font-weight: 700;
}

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }

/* Navbar */
.navbar {
    background-color: rgba(11, 12, 16, 0.95);
    border-bottom: 1px solid var(--border-gold);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-right-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Language Switcher Dropdown */
.lang-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.lang-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    color: var(--gold);
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-dropdown-btn:hover {
    background: var(--bg-darker);
    border-color: var(--gold-bright);
    color: var(--gold-bright);
}

.lang-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-luxury);
    min-width: 160px;
    padding: 0.4rem 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.lang-dropdown-menu.hidden {
    display: none !important;
}

.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.8rem;
    color: var(--text-main);
    font-size: 0.825rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.lang-dropdown-item:hover,
.lang-dropdown-item.active {
    background-color: var(--bg-darker);
    color: var(--gold);
}

.user-dropdown-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
}

.user-avatar-small {
    font-size: 0.7rem;
}

.flag-icon {
    border-radius: 1px;
    display: inline-block;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFFFFF;
}

.gold-crest {
    color: var(--gold);
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.user-dropdown {
    position: relative;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-luxury);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 100;
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-main);
    font-size: 0.875rem;
}

.dropdown-menu a:hover {
    background-color: var(--bg-darker);
    color: var(--gold);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-gold {
    background: linear-gradient(135deg, #D4AF37 0%, #AA7C11 100%);
    color: #0B0C10;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #FFD700 0%, #D4AF37 100%);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
}

.gold-border {
    border-color: var(--gold);
    color: var(--gold);
}

.gold-border:hover {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--gold-bright);
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
}

/* Cards & Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.section {
    padding: 3rem 0;
}

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

.card {
    background-color: var(--bg-card);
    border-radius: 2px;
    padding: 10px 1.5rem;
    border: 1px solid var(--border-dark);
    position: relative;
    display: flex;
    flex-direction: column;
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.card-body .btn,
.card-body .gold-link,
.card-body a.btn,
.card-body a.gold-link {
    margin-top: auto;
}

.card-luxury {
    border: 1px solid var(--border-gold);
    border-radius: 2px;
    box-shadow: var(--shadow-luxury);
    background: linear-gradient(145deg, #1F2833 0%, #151C24 100%);
}

.card-icon {
    display: none !important;
}

.card-title {
    margin-top: 5px;
    margin-bottom: 0.75rem;
    padding: 6px 12px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.85) 0%, rgba(212, 175, 55, 0.25) 70%, transparent 100%);
    border-left: 3px solid var(--gold-bright);
    border-radius: 2px;
    color: #FFFFFF !important;
    display: block;
    font-family: var(--font-heading);
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .nav-menu { display: none; }
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

/* Hero Section with Scaled Background Image */
.hero-section {
    position: relative;
    padding: 4.3125rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(11, 12, 16, 0.75) 0%, rgba(11, 12, 16, 0.9) 100%),
                url('/images/family.jpg') no-repeat center center;
    background-size: auto 100%;
    border-bottom: 1px solid var(--border-gold);
    box-shadow: inset 0 -20px 30px var(--bg-main);
}

.hero-subtitle {
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--gold);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.3);
    margin: 0.25rem 0 0.6rem;
}

.hero-description {
    font-size: 1.1rem;
    color: #E0E0E0;
    max-width: 700px;
    margin: 0 auto 1.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

/* Tree Interactive Engine Styles */
.tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 1rem;
}

.btn-group {
    display: inline-flex;
    gap: 0.5rem;
}

.tree-viewport {
    width: 100%;
    height: 700px;
    background-color: #07080a;
    background-image: radial-gradient(rgba(212, 175, 55, 0.15) 1px, transparent 0);
    background-size: 24px 24px;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), var(--shadow-luxury);
    cursor: grab;
    overflow: hidden;
    position: relative;
    touch-action: none;
}

.tree-viewport:active {
    cursor: grabbing;
}

#tree-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tree-node-card {
    background: linear-gradient(135deg, #1F2833 0%, #12161D 100%);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.8rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tree-node-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    border-color: var(--gold-bright);
}

.node-male { border-left: 4px solid #3498db; }
.node-female { border-left: 4px solid #e84393; }

.node-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.node-gender {
    font-size: 0.9rem;
    font-weight: bold;
}

.node-male .node-gender { color: #3498db; }
.node-female .node-gender { color: #e84393; }

.node-name {
    font-size: 0.85rem;
    font-family: var(--font-heading);
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-maiden {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.node-dates {
    font-size: 0.72rem;
    color: var(--gold);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--gold);
    box-shadow: var(--shadow-luxury);
}

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gold-bright);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge-gold { background-color: var(--gold); color: #0B0C10; }
.badge-admin { background-color: #e74c3c; color: #fff; }
.badge-editor { background-color: #3498db; color: #fff; }

.role-short {
    display: none;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-dark);
}

.table th {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 0.85rem;
}

/* Mobile Hamburger Button & Navigation Drawer */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.mobile-nav-toggle span {
    width: 100%;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-lang-selector {
    display: none;
}

@media (max-width: 768px) {
    .lang-dropdown-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
        gap: 3px;
    }

    .lang-code-text {
        display: none !important;
    }
}

@media (max-width: 868px) {
    .role-full {
        display: none !important;
    }

    .role-short {
        display: inline !important;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-darker);
        border-bottom: 1px solid var(--border-gold);
        padding: 1rem 1.5rem;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8);
        gap: 0.75rem;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.5rem 0;
    }

    .mobile-lang-selector {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-dark);
        margin-top: 0.25rem;
    }

    .mobile-lang-item {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 0.35rem 0.75rem;
        border: 1px solid var(--border-gold);
        border-radius: var(--radius-md);
        color: var(--text-main);
        font-size: 0.85rem;
        font-weight: 600;
        background-color: var(--bg-card);
        transition: all 0.2s ease;
    }

    .mobile-lang-item:hover,
    .mobile-lang-item.active {
        background-color: var(--gold);
        color: #0B0C10;
        border-color: var(--gold-bright);
    }
}

/* Footer */
.footer {
    margin-top: auto;
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border-gold);
    padding: 2.5rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
