/* 
  ICAR-CMFRI Museum Application CSS 
  Premium, responsive styling for Web & Mobile
*/

:root {
    --cmfri-blue: #0056b3;
    --cmfri-dark-blue: #003d82;
    --cmfri-green: #28a745;
    --cmfri-light-blue: #e8f4fd;
    --text-main: #333333;
    --text-muted: #6c757d;
}

html {
    /* Keep a balanced baseline so headings do not appear oversized at 100% zoom */
    font-size: 16px;
}

@media (min-width: 992px) {
    html {
        /* Make the full desktop site render like 80% browser zoom */
        zoom: 0.8;
    }

    /* Fallback for browsers that do not support zoom (e.g., Firefox) */
    @supports not (zoom: 1) {
        body {
            transform: scale(0.8);
            transform-origin: top left;
            width: 125%;
        }
    }

    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 1.03rem;
    line-height: 1.55;
    color: var(--text-main);
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    /* Prevent default tap highlights on mobile */
    -webkit-tap-highlight-color: transparent;
}

/* Top Bar */
.top-bar {
    background-color: var(--cmfri-blue);
    font-size: 0.85rem;
}

.top-bar .hover-white:hover {
    color: white !important;
}

/* Header & Brand */
.header-title {
    font-size: 1rem;
    color: var(--text-main);
    letter-spacing: 0.5px;
}
.header-subtitle {
    font-size: 1.12rem;
    color: var(--cmfri-blue) !important;
    letter-spacing: 0.5px;
}

/* Navbar */
.navbar {
    border-bottom: 2px solid var(--cmfri-blue);
    /* Glassmorphism for Top Bar */
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar-nav .nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.navbar-nav .nav-link:hover, 
.navbar-nav .nav-link.active {
    color: var(--cmfri-blue) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--cmfri-blue);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s ease-in-out;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

/* Hero Section */
.hero-section {
    position: relative;
    background: url('https://images.unsplash.com/photo-1582967788606-a171c1080cb0?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center;
    background-size: cover;
    height: auto;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0, 86, 179, 0.85) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
}

.hero-title {
    font-weight: 700;
    font-size: 2.15rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.brand-heading {
    line-height: 1.15;
}

.brand-line-1 {
    display: block;
    font-size: 1.58rem;
    font-weight: 700;
    color: #1f2a38;
}

.brand-line-2 {
    display: block;
    font-size: 1.72rem;
    font-weight: 800;
    color: #0f5dc7;
    letter-spacing: 0.2px;
}

.official-hero-subtitle {
    font-size: 1.45rem;
    line-height: 1.45;
}

.official-mission-title {
    font-size: 2.1rem;
    letter-spacing: 1.2px !important;
}

.official-mission-text {
    font-size: 1.35rem;
    line-height: 1.6;
}

/* Footer typography aligned to official visual scale */
.footer {
    font-size: 1.16rem;
    line-height: 1.65;
}

.footer h5 {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem !important;
}

.footer p,
.footer a,
.footer li,
.footer .text-white-50 {
    font-size: 1.24rem;
}

.footer .fw-bold {
    font-weight: 700 !important;
}

.footer-links-list {
    line-height: 1.9;
}

.footer-meta-row,
.footer-meta-row p,
.footer-meta-row a {
    font-size: 1.12rem !important;
}

/* Content Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Animations */
.hover-elevate {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-elevate:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}
.transition-all {
    transition: all 0.3s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cmfri-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 86, 179, 0.25);
}

.btn-primary {
    background-color: var(--cmfri-blue);
    border-color: var(--cmfri-blue);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    /* Improved touch targets */
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background-color: var(--cmfri-dark-blue);
    border-color: var(--cmfri-dark-blue);
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--cmfri-green);
    border-color: var(--cmfri-green);
}

/* Table styling for Search Results */
.table-custom {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.table-custom thead {
    background-color: var(--cmfri-light-blue);
    color: var(--cmfri-dark-blue);
}

.table-custom th {
    font-weight: 600;
    border-bottom: 2px solid var(--cmfri-blue);
}

.table-custom tbody tr:hover {
    background-color: rgba(0, 86, 179, 0.05);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    /* Accommodate bottom nav bar */
    body {
        padding-bottom: 75px;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .header-title, .header-subtitle {
        font-size: 1rem;
    }
    /* Reduce giant quote icon size on mobile */
    .fa-quote-left {
        font-size: 1.5rem !important;
    }
    /* Scale down display headings on mobile */
    .display-5 {
        font-size: 2rem;
    }
    .lead {
        font-size: 1.1rem !important;
    }
    /* Form controls taller on mobile for easy tapping */
    .form-control, .form-select, .btn {
        min-height: 48px;
    }

    .footer h5 {
        font-size: 1.5rem;
    }

    .footer p,
    .footer a,
    .footer li,
    .footer .text-white-50 {
        font-size: 1.06rem;
    }

    .footer-meta-row,
    .footer-meta-row p,
    .footer-meta-row a {
        font-size: 0.98rem !important;
    }
}

/* ========================================================
   MOBILE BOTTOM APP NAVIGATION
   ======================================================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid #eaeaea;
    z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* For iPhone notch */
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 25%;
    padding: 10px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    user-select: none;
    transition: all 0.2s ease-out;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.mobile-nav-item:hover {
    color: var(--cmfri-blue);
}

.mobile-nav-item.active {
    color: var(--cmfri-blue);
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
    filter: drop-shadow(0 2px 4px rgba(0,86,179,0.3));
}

/* ========================================================
   SPLASH SCREEN ANIMATIONS
   ======================================================== */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #e8f4fd 0%, #ffffff 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

@media (min-width: 992px) {
    /* The desktop page uses 80% zoom; keep the fixed welcome overlay full-screen. */
    #splash-screen {
        width: 125vw;
        height: 125vh;
    }
}

#splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-fish {
    height: 120px;
    animation: swimIn 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

.splash-text {
    margin-top: 1.5rem;
    font-size: 1.8rem;
    line-height: 1.4;
    font-weight: 700;
    color: var(--cmfri-dark-blue);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out 1s forwards;
    letter-spacing: 1px;
}

@keyframes swimIn {
    0% {
        transform: translateX(-150vw) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateX(10vw) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================
   PREMIUM GLASSMORPHISM CAROUSEL
   ======================================================== */
.full-contain-img {
    height: 70vh; /* Adjust height based on preference */
    width: 100%;
    object-fit: contain; /* The most important rule to never crop */
    object-position: center;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0px 25px 40px rgba(0,0,0,0.8)); /* Makes the sharp image pop powerfully */
}

.carousel-bg-blur {
    position: absolute;
    top: -5%;
    left: -5%;
    right: -5%;
    bottom: -5%;
    background-size: cover;
    background-position: center;
    filter: blur(25px) brightness(0.3); /* Darkened blur to hide edges and create glow */
    z-index: 1;
}

.custom-carousel-controls {
    position: absolute;
    bottom: 40px;
    left: 8%; /* Relative to container alignment usually, but absolute works */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10;
}

.custom-carousel-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    padding: 8px 12px;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-carousel-btn:hover {
    color: var(--cmfri-blue);
    transform: scale(1.1);
}

.controls-divider {
    width: 1px;
    height: 20px;
    background-color: #ccc;
    margin: 0 8px;
}

@media (max-width: 768px) {
    .full-contain-img {
        height: 40vh;
    }
    .custom-carousel-controls {
        bottom: 20px;
        left: 20px;
        padding: 5px 12px;
    }
    .custom-carousel-btn {
        font-size: 1.1rem;
        padding: 6px 10px;
    }
}
