/* -----------------------------
   Top navigation
----------------------------- */
.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;

    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.15);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3),
                0 0 15px rgba(0, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.2s ease;
}

/* Hamburger menu button - hidden on desktop */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background: #00ffff;
    border-radius: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 4px rgba(0, 255, 255, 0.6);
}

.mobile-menu-toggle:hover {
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

.mobile-menu-toggle:hover span {
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.8);
}

.mobile-menu-toggle:focus-visible {
    outline: 2px solid rgba(0, 255, 255, 0.6);
    outline-offset: 2px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.topnav a {
    color: #e5e7eb;
    text-decoration: none;
    display: inline-block;
    position: relative;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease;
}

.topnav a:hover {
    color: #00ffff;
    background: rgba(0, 255, 255, 0.08);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.topnav a:focus-visible {
    outline: 2px solid rgba(0, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Active page indicator */
.topnav a.active {
    color: #00ffff;
    background: rgba(0, 255, 255, 0.12);
    border: 1px solid rgba(0, 255, 255, 0.35);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.topnav a.active:hover {
    background: rgba(0, 255, 255, 0.15);
    border-color: rgba(0, 255, 255, 0.5);
}

/* User greeting in dropdown - hidden on desktop */
.nav-user-dropdown {
    display: none;
}

/* Brand link */
.nav-left a.nav-brand {
    font-weight: 700;
    margin-right: 0.5rem;
}

/* Desktop: dot separators between nav items */
.nav-left a + a::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.35);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.95;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    background: rgba(0, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 255, 0.08);
}

.nav-user {
    color: #94a3b8;
    font-size: 0.9rem;
}

.topnav .logout {
    color: #f87171;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.25);
    transition: all 0.2s ease;
}

.topnav .logout:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.5);
}

/* Mobile navigation - hamburger menu */
@media (max-width: 768px) {
    .topnav {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(2, 6, 23, 0.95);
        backdrop-filter: blur(10px);
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-left {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(2, 6, 23, 0.98);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(0, 255, 255, 0.2);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        flex-direction: column;
        padding: 1rem 1.25rem;
        gap: 0.5rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease, padding 0.35s ease, opacity 0.25s ease;
        margin-top: 0.5rem;
        border-radius: 8px;
    }
    
    .topnav.mobile-menu-open .nav-left {
        max-height: 500px;
        padding: 1rem 1.25rem;
        opacity: 1;
    }

    .nav-user-dropdown {
        display: block;
        color: #94a3b8;
        font-size: 0.85rem;
        padding: 0.5rem 0 0.75rem;
        margin-bottom: 0.25rem;
        border-bottom: 1px solid rgba(0, 255, 255, 0.12);
        flex-shrink: 0;
    }
    
    .nav-left a {
        width: 100%;
        padding: 0.75rem 1rem;
        margin-right: 0;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-radius: 8px;
        border: 1px solid transparent;
        transition: all 0.2s ease;
    }
    
    .nav-left a::before {
        display: none;
    }
    
    .nav-left a:hover {
        background: rgba(0, 255, 255, 0.1);
        border-color: rgba(0, 255, 255, 0.3);
    }
    
    .nav-left a.active {
        background: rgba(0, 255, 255, 0.12);
        border-color: rgba(0, 255, 255, 0.35);
    }
    
    .nav-right {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.2rem 0;
    }
    
    .nav-user {
        display: inline;
        font-size: 0.8rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .nav-right .logout {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        padding: 0.4rem 0.85rem;
        border-radius: 999px;
        border: 1px solid rgba(248, 113, 113, 0.3);
        transition: all 0.2s ease;
    }
    
    .nav-right .logout:hover {
        background: rgba(248, 113, 113, 0.1);
        border-color: #f87171;
    }
    
    /* Hamburger animation when menu is open */
    .topnav.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .topnav.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }
    
    .topnav.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

/* Small screens: additional optimizations */
@media (max-width: 520px) {
    .topnav {
        padding: 0.5rem;
    }
    
    .nav-left {
        padding: 0.75rem;
    }
    
    .topnav.mobile-menu-open .nav-left {
        padding: 0.75rem;
    }
    
    .nav-left a {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .nav-right .logout {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* -----------------------------
   Base layout
----------------------------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Courier New', 'Consolas', 'Monaco', 'Lucida Console', 'Menlo', monospace, sans-serif;
    background: #0a0a0f;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 20% 50%, rgba(0, 100, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0f 0%, #0d0d1a 25%, #0a0a15 50%, #0d0d1a 75%, #0a0a0f 100%);
    background-size: 50px 50px, 50px 50px, 100% 100%, 100% 100%, 100% 100%;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
    color: #e5e7eb;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(0, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(138, 43, 226, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* -----------------------------
   Container
----------------------------- */
.container {
    max-width: 1600px;
    margin: 1.5rem auto;
    padding: 2rem;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5),
                0 0 20px rgba(0, 255, 255, 0.1),
                inset 0 0 60px rgba(0, 100, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.1);
    width: calc(100% - 2rem);
}

@media (max-width: 768px) {
    .container {
        width: calc(100% - 1rem);
        margin: 1rem auto;
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }
    
    p {
        font-size: 0.95rem;
        line-height: 1.7;
        margin-bottom: 1rem;
    }
    
    /* Improve spacing on mobile */
    .container > *:first-child {
        margin-top: 0;
    }
    
    .container > *:last-child {
        margin-bottom: 0;
    }
}

/* Reduced padding for camera page */
.container .content {
    margin: 0;
    padding: 0;
}

/* Target container when it has main-container inside (camera page) */
.container:has(.main-container) {
    padding: 1rem;
    margin: 1rem auto;
}

/* Fallback for browsers that don't support :has() */
@supports not selector(:has(*)) {
    .container .main-container {
        margin-top: -1rem;
        margin-left: -1rem;
        margin-right: -1rem;
        margin-bottom: -1rem;
    }
}

@media (max-width: 768px) {
    .container:has(.main-container) {
        padding: 0.5rem;
        margin: 0.5rem auto;
    }
    
    @supports not selector(:has(*)) {
        .container .main-container {
            margin: -0.5rem;
        }
    }
}

@media (min-width: 1920px) {
    .container:has(.main-container) {
        max-width: 95vw;
        padding: 1rem;
    }
}

.container-login {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2.5rem;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5),
                0 0 20px rgba(0, 255, 255, 0.1),
                inset 0 0 60px rgba(0, 100, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.1);
}

/* Mobile login container */
@media (max-width: 480px) {
    .container-login {
        max-width: calc(100% - 2rem);
        margin: 2rem auto;
        padding: 1.5rem;
    }
}

/* -----------------------------
   Typography
----------------------------- */
h1 {
    margin-top: 0;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5),
                 0 0 20px rgba(0, 255, 255, 0.3);
}

p {
    line-height: 1.6;
}

/* -----------------------------
   Status box
----------------------------- */
.status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1),
                inset 0 0 20px rgba(0, 100, 255, 0.05);
}

/* Mobile status box improvements */
@media (max-width: 768px) {
    .status {
        padding: 0.75rem;
        font-size: 0.9rem;
        line-height: 1.8;
        margin-top: 1rem;
    }
    
    .status br {
        display: block;
        margin: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    .status {
        padding: 1rem;
        font-size: 0.85rem;
        line-height: 2;
        border-radius: 6px;
    }
    
    .status br {
        margin: 0.75rem 0;
    }
    
    /* Improve status indicator visibility on mobile */
    .status .ok,
    .status .err {
        display: inline-block;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-weight: 600;
    }
    
    .status .ok {
        background: rgba(74, 222, 128, 0.1);
        border: 1px solid rgba(74, 222, 128, 0.3);
    }
    
    .status .err {
        background: rgba(248, 113, 113, 0.1);
        border: 1px solid rgba(248, 113, 113, 0.3);
    }
}

.ok { color: #4ade80; }
.err { color: #f87171; }
.success { color: #4ade80; }

/* -----------------------------
   Footer
----------------------------- */
footer {
    margin-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* -----------------------------
   Grafana iframe (contained)
----------------------------- */
.grafana-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
}

.grafana-frame {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    border: none;
    border-radius: 8px;
    display: block;
}

/* Mobile optimizations for Grafana iframe */
@media (max-width: 768px) {
    .grafana-wrapper {
        margin: 0 -0.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .grafana-frame {
        height: 60vh;
        min-height: 400px;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .grafana-frame {
        height: 50vh;
        min-height: 350px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .grafana-frame {
        height: 45vh;
        min-height: 300px;
    }
}

/* Dashboard-only layout (System Performance Monitor) */
.container.dashboard-only {
    max-width: none;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container.dashboard-only .grafana-wrapper {
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.container.dashboard-only .grafana-frame {
    height: 100%;
    min-height: 100vh;
    border-radius: 0;
}

/* -----------------------------
   Camera page layout (HQ Surveillance)
----------------------------- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;

    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(11, 18, 32, 0.7);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
}

.topbar .title {
    font-weight: 700;
    color: #e5e7eb;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border: 1px solid #1e293b;
    border-radius: 999px;
    color: #e5e7eb;
    text-decoration: none;
    background: transparent;
    font-size: 0.95rem;
}

.tab:hover {
    text-decoration: none;
    border-color: #38bdf8;
}

.tab.active {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #020617;
    font-weight: 600;
}

/* CSS Variables for dynamic frame sizing */
:root {
    --camera-frame-width: 640px;
    --camera-frame-height: 480px;
    --camera-grid-columns: 2;
    --camera-grid-template: repeat(2, 640px);
}

/* Camera controls slider */
.camera-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
}

.camera-controls-label {
    color: #e5e7eb;
    margin-right: 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.camera-controls-label span {
    color: #00ffff;
    font-weight: bold;
}

#frame-size-slider {
    flex: 1;
    max-width: 400px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(0, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

#frame-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    transition: all 0.2s ease;
}

#frame-size-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    transform: scale(1.1);
}

#frame-size-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    transition: all 0.2s ease;
}

#frame-size-slider::-moz-range-thumb:hover {
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    transform: scale(1.1);
}

.main-container {
    display: grid;
    grid-template-columns: var(--camera-grid-template, repeat(2, var(--camera-frame-width, 640px))) !important;
    gap: 2rem;
    width: 100%;
    justify-content: center;
    align-items: start;
    transition: grid-template-columns 0.2s ease;
}

/* Responsive grid scaling - baseline for initial load (overridden by JS) */
@media (min-width: 1920px) {
    .main-container {
        grid-template-columns: var(--camera-grid-template, repeat(3, var(--camera-frame-width, 640px))) !important;
    }
}

@media (max-width: 1400px) {
    .main-container {
        grid-template-columns: var(--camera-grid-template, repeat(2, var(--camera-frame-width, 640px))) !important;
    }
}

@media (max-width: 1400px) and (min-width: 1320px) {
    .main-container {
        gap: 1.5rem;
    }
}

@media (max-width: 720px) {
    .main-container {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        justify-items: stretch;
    }
    
    .video-wrapper {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .child-container {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9; /* Better aspect ratio for mobile */
        min-height: 200px;
        touch-action: manipulation;
    }
    
    /* Improve fullscreen button accessibility on mobile */
    .child-container:focus {
        outline: 2px solid rgba(0, 255, 255, 0.6);
        outline-offset: 2px;
    }
}

@media (max-width: 680px) {
    .video-wrapper {
        width: 100% !important;
        max-width: 100vw;
    }
    
    .child-container {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9; /* Better for mobile */
        max-width: 100vw;
        min-height: 200px;
    }
    
    .main-container {
        gap: 1rem;
        padding: 0;
    }
    
    /* Prevent horizontal scroll on mobile */
    body {
        overflow-x: hidden;
    }
    
    .container {
        overflow-x: hidden;
    }
}

@media (max-width: 600px) {
    .main-container {
        gap: 1rem;
    }
    
    .camera-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .camera-controls-label {
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
        text-align: center;
    }
    
    #frame-size-slider {
        max-width: 100%;
        min-height: 44px; /* Touch-friendly slider */
        padding: 0.5rem 0;
        height: 8px;
    }
    
    /* Larger slider thumb on mobile */
    #frame-size-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    #frame-size-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
    
    /* Improve touch targets for camera containers */
    .child-container {
        min-height: 200px;
        touch-action: manipulation; /* Prevent double-tap zoom */
    }
}

/* Mobile devices - force responsive behavior */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
        margin: 0.5rem auto;
        width: calc(100% - 1rem);
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    .video-wrapper {
        width: 100% !important;
    }
    
    .child-container {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9; /* Better for mobile screens */
        min-height: 200px;
        touch-action: manipulation;
    }
    
    .cruise-info-container {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    .cruise-info-city {
        font-size: 0.95rem;
    }
    
    .animal-info-title {
        font-size: 0.65rem;
    }
    
    .animal-info-container {
        padding: 0.3rem 1rem;
    }
    
    .cruise-info-details {
        font-size: 0.75rem;
    }
    
    .main-container {
        gap: 1rem;
        padding: 0;
    }
    
    .camera-controls {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .camera-controls-label {
        font-size: 0.85rem;
    }
    
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .tabs {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab {
        min-height: 44px; /* Touch-friendly */
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        flex: 1 1 auto;
        min-width: calc(50% - 0.25rem);
        text-align: center;
    }
    
    /* Prevent horizontal scroll on all elements */
    * {
        max-width: 100%;
    }
    
    img, iframe, video {
        max-width: 100%;
        height: auto;
    }
    
    /* Ensure camera images are responsive */
    .child-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Video wrapper containing info and video */
.video-wrapper {
    display: flex;
    flex-direction: column;
    width: var(--camera-frame-width, 640px);
    gap: 0.5rem;
}

/* Cruise information container */
.cruise-info-container {
    background: rgba(2, 6, 23, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

.cruise-info-city {
    font-weight: 700;
    color: #00ffff;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.animal-info-title {
    font-weight: 700;
    color: #00ffff;
    font-size: 0.65rem;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.animal-info-container {
    padding: 0.3rem 1rem;
}

.cruise-info-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #e5e7eb;
    font-size: 0.8rem;
}

.cruise-info-cruise {
    color: #00ffff;
    font-weight: 600;
}

.cruise-info-event {
    color: #38bdf8;
    text-transform: capitalize;
}

.cruise-info-datetime {
    color: #cbd5e1;
}

.cruise-info-no-events {
    color: #94a3b8;
    font-style: italic;
}

.child-container {
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.6);
    width: var(--camera-frame-width, 640px);
    height: var(--camera-frame-height, 480px);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
    transition: width 0.2s ease, height 0.2s ease;
    touch-action: manipulation; /* Prevent double-tap zoom on mobile */
    -webkit-tap-highlight-color: rgba(0, 255, 255, 0.2); /* Mobile tap highlight */
}

.child-container:hover {
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Mobile touch feedback */
@media (max-width: 768px) {
    .child-container:active {
        transform: scale(0.98);
        border-color: rgba(0, 255, 255, 0.7);
    }
    
    /* Improve button touch feedback */
    button:active {
        transform: scale(0.97);
    }
    
    /* Improve link touch feedback */
    a:active {
        opacity: 0.8;
    }
}

.child-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}


/* -----------------------------
   Form elements (cyber theme)
----------------------------- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input:not([type]) {
    background: rgba(2, 6, 23, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    color: #00ffff;
    padding: 0.5rem;
    font-family: 'Courier New', 'Consolas', 'Monaco', 'Lucida Console', 'Menlo', monospace, sans-serif;
    width: 100%;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly target */
    font-size: 16px; /* Prevent zoom on iOS */
    touch-action: manipulation;
}

/* Mobile input improvements */
@media (max-width: 768px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input:not([type]) {
        padding: 0.75rem;
        font-size: 16px; /* Prevent iOS zoom */
    }
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input:not([type]):focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4),
                inset 0 0 10px rgba(0, 255, 255, 0.1);
}

button {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 4px;
    color: #00ffff;
    padding: 0.5rem 1.5rem;
    font-family: 'Courier New', 'Consolas', 'Monaco', 'Lucida Console', 'Menlo', monospace, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
    min-height: 44px; /* Touch-friendly target */
    touch-action: manipulation; /* Prevent double-tap zoom */
}

button:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Mobile button improvements */
@media (max-width: 768px) {
    button {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Inline buttons should not be full width */
    button:not([type="submit"]):not([type="button"]) {
        width: auto;
    }
    
    /* Buttons in forms should be full width */
    form button[type="submit"],
    form button[type="button"] {
        width: 100%;
    }
}

label {
    color: #e5e7eb;
    display: block;
    margin-bottom: 0.25rem;
}

/* Mobile label improvements */
@media (max-width: 768px) {
    label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
}

/* -----------------------------
   Mobile-specific touch optimizations
----------------------------- */
@media (max-width: 768px) {
    /* Improve tap targets */
    a, button, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent text selection on interactive elements */
    button, .tab, .child-container {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Improve scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better focus indicators for mobile */
    a:focus, button:focus, input:focus {
        outline: 2px solid rgba(0, 255, 255, 0.6);
        outline-offset: 2px;
    }
}

/* -----------------------------
   Additional mobile breakpoints
----------------------------- */
@media (max-width: 1024px) {
    .container {
        max-width: calc(100% - 2rem);
    }
}

@media (max-width: 600px) {
    /* Improve spacing on small screens */
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.35rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 375px) {
    /* Extra small screens */
    .container {
        padding: 0.75rem;
        margin: 0.5rem auto;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    p {
        font-size: 0.9rem;
    }
}

/* -----------------------------
   Hero Section
----------------------------- */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.hero-title {
    color: #00ffff;
    font-size: 3rem;
    margin: 0 0 1rem 0;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5),
                 0 0 20px rgba(0, 255, 255, 0.3),
                 0 0 30px rgba(0, 255, 255, 0.2);
    letter-spacing: 0.05em;
}

.hero-subtitle {
    color: #e5e7eb;
    font-size: 1.25rem;
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-welcome {
    color: #00ffff;
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.8;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .hero-welcome {
        font-size: 1rem;
    }
}

/* -----------------------------
   Feature Cards Grid
----------------------------- */
.feature-cards-section {
    margin-bottom: 2rem;
}

.feature-cards-title {
    color: #00ffff;
    font-size: 1.75rem;
    margin: 0 0 1.5rem 0;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    font-weight: 600;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    display: block;
    text-decoration: none;
    background: rgba(2, 6, 23, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
                0 0 20px rgba(0, 255, 255, 0.15),
                inset 0 0 30px rgba(0, 100, 255, 0.08);
    min-height: 120px;
    position: relative;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 255, 0.1);
    pointer-events: none;
}

.feature-card:hover {
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(0, 255, 255, 0.4),
                inset 0 0 40px rgba(0, 100, 255, 0.15);
    transform: translateY(-4px);
    text-decoration: none;
    background: rgba(2, 6, 23, 0.9);
}

.feature-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feature-card-title {
    color: #00ffff;
    font-size: 1.25rem;
    margin: 0;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.feature-card-description {
    color: #e5e7eb;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .feature-cards-section {
        margin-bottom: 1.5rem;
    }
    
    .feature-cards-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1.25rem;
    }
    
    .feature-card-title {
        font-size: 1.1rem;
    }
    
    .feature-card-description {
        font-size: 0.85rem;
    }
}

/* -----------------------------
   Status Section
----------------------------- */
.status-section {
    margin-top: 2rem;
}

.status-section-title {
    color: #00ffff;
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.status-card {
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1),
                inset 0 0 20px rgba(0, 100, 255, 0.05);
}

.status-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.status-card-label {
    color: #e5e7eb;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

.status-indicator.status-ok {
    background: #4ade80;
    color: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.status-indicator.status-err {
    background: #f87171;
    color: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

.status-card-value {
    color: #e5e7eb;
    font-size: 1.1rem;
    font-weight: 600;
}

.status-card-value.status-ok {
    color: #4ade80;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.status-card-value.status-err {
    color: #f87171;
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

@media (max-width: 768px) {
    .status-section {
        margin-top: 1.5rem;
    }
    
    .status-section-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .status-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .status-card {
        padding: 1rem;
    }
    
    .status-card-label {
        font-size: 0.85rem;
    }
    
    .status-card-value {
        font-size: 1rem;
    }
}
