:root {
    --bg-body: #0b0d14;
    --bg-surface: #151921;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --nav-height: 70px;
    --glass-bg: rgba(11, 13, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Layout */
.page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

main {
    flex: 1 0 auto; /* Grow, don't shrink, auto basis */
    display: flex;
    flex-direction: column;
    padding-top: var(--nav-height); /* Space for fixed header */
    width: 100%;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
    color: #fff;
    font-weight: 600;
    letter-spacing: -0.025em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Navbar Styling */
.navbar-custom {
    height: var(--nav-height);
    background-color: rgba(5, 6, 8, 0.95); /* Matches footer #050608 but slightly translucent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-brand-custom {
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff !important;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 100%;
    margin-right: 2rem;
}

.navbar-brand-custom span {
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5)); /* Subtle neon glow for logo */
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
}

/* "Classic Tech" Style Navigation */
.nav-link-custom {
    color: #94a3b8 !important; /* Muted slate */
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0 0.5rem;
    margin: 0 0.2rem; /* Reduced margin to fit fixed widths */
    height: 100%;
    min-width: 110px; /* "About same size" - enforces a consistent base width */
    border-radius: 0;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center; /* Centers content within the fixed width */
    gap: 0.6rem;
    background-color: transparent !important;
    border: none !important;
    position: relative;
}

.nav-link-custom .oi {
    margin-right: 0 !important;
    top: 0; /* Ensure no relative offset */
    font-size: 1.1rem; /* Slightly larger icon for balance */
    line-height: 1;
    display: inline-flex; /* Better for icon alignment */
    align-items: center;
    justify-content: center;
    height: 100%; /* Match parent height to force vertical center */
    color: inherit;
    transition: color 0.3s ease;
}

/* Fix for specific text alignment issues */
.nav-link-custom span:not(.oi) {
    line-height: 1; /* Reset text line height to avoid baseline shifts */
    display: inline-block;
    padding-top: 1px; /* Micro-adjustment if text feels too high/low */
}

/* Hover State */
.nav-link-custom:hover {
    color: #fff !important;
}

/* Active State: "When active the text is blue" */
.nav-link-custom.active {
    color: var(--primary) !important;
}

.nav-link-custom.active .oi {
    color: var(--primary);
}

/* The Line: "colorful (blueish) line below when hovering" */
.nav-link-custom::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -5px; /* Moved down from 0 to -5px */
    left: 50%;
    background-color: var(--primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6); /* Glowy line */
    border-radius: 3px 3px 0 0;
    display: block; /* Re-enable */
}

.nav-link-custom:hover::after, .nav-link-custom.active::after {
    width: 100%;
}

/* Glass Dropdown */
.dropdown-menu-dark {
    background-color: rgba(21, 25, 33, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* Nav dropdown trigger: replace default caret with a cleaner chevron */
.nav-link-custom.dropdown-toggle::after {
    display: none !important;
}

.nav-dropdown-chevron {
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-link-custom[aria-expanded="true"] .nav-dropdown-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.dropdown-item {
    color: var(--text-muted);
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: #fff;
    padding-left: 1.5rem; /* Slide effect */
}

/* Navbar Form Controls (Selectors) */
.navbar-custom .form-select {
    background-color: #151921 !important; /* Force dark background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.25rem 2rem 0.25rem 0.75rem; /* Compact */
    border-radius: 20px; /* Pill shape */
    cursor: pointer;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); /* Custom dark arrow */
}

.navbar-custom .form-select option {
    background-color: #151921;
    color: var(--text-muted);
}

.navbar-custom .form-select:hover, .navbar-custom .form-select:focus {
    background-color: #1e2430 !important;
    border-color: var(--text-muted);
    color: #fff;
    box-shadow: none;
}

/* Mobile Toggle */
.navbar-toggler {
    border: none;
    color: var(--text-main);
}
.navbar-toggler:focus {
    box-shadow: none;
}

/* Cards (Gallery) */
.card-custom {
    background-color: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-custom:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: var(--primary);
}

.card-custom img {
    height: 250px;
    object-fit: cover;
    width: 100%;
}

.card-body-custom {
    padding: 1.5rem;
}

/* Buttons */
.btn-primary-custom {
    background-color: var(--primary);
    border: none;
    color: #000;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    color: #000;
}

.btn-outline-custom {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
}

.btn-outline-custom:hover,
.btn-outline-custom:focus,
.btn-outline-custom:active {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.08);
}

/* Glass Card (Updates Box) */
.glass-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.glass-card h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

/* Custom List Styling */
.list-custom li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.list-custom li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.text-link-custom {
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.2s;
}
.text-link-custom:hover {
    color: var(--primary);
}

/* Footer Custom */
.footer-custom {
    background-color: #050608; /* Darker than body */
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.85rem;
}

.footer-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    line-height: 1;
}

.footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-social-text {
    display: inline-flex;
    align-items: center;
}

.footer-social-instagram {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, #f58529 0%, #dd2a7b 35%, #8134af 70%, #515bd4 100%);
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

.footer-social-instagram:hover,
.footer-social-instagram:focus {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.footer-social-astrobin {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(135deg, #0b1220 0%, #14213d 45%, #1b2a49 100%);
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

.footer-social-astrobin:hover,
.footer-social-astrobin:focus {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.32);
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.footer-heading {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

.footer-link {
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.6rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary);
    text-decoration: none;
}

/* List Group Dark Mode Overrides */
.list-group-item {
    background-color: var(--bg-surface);
    border-color: var(--glass-border);
    color: var(--text-main);
}

.list-group-item.bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-main);
}

/* Form Controls Dark Mode */
.form-control, .form-select {
    background-color: var(--bg-surface);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-surface);
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled, .form-select:disabled {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Alerts Dark Mode */
.alert-info {
    background-color: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    color: #bae6fd;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.alert-warning {
    background-color: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.3);
    color: #fde047;
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

/* Remove blue focus border/shadow from all buttons and icons */
.btn:focus, 
.btn:active, 
.btn:focus-visible, 
.btn-close:focus, 
.btn-link:focus {
    box-shadow: none !important;
    outline: none !important;
}
