/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Russo+One&family=Anton&display=swap');

/* CSS Variables */
:root {
    --crab-red: #E63946;
    --gold: #FFD700;
    --ocean-blue: #457B9D;
    --deep-green: #2A9D8F;
    --black: #1D1D1D;
    --white: #F9F9F9;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--crab-red) 100%, var(--deep-green) 100%);
    color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Animated Bubbles Background */
.bubbles {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    top: 0;
    left: 0;
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: -100px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: rise 15s infinite ease-in;
}

.bubble:nth-child(1) {
    left: 10%;
    width: 80px;
    height: 80px;
    animation-duration: 11s;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    left: 20%;
    width: 20px;
    height: 20px;
    animation-duration: 8s;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    left: 35%;
    width: 50px;
    height: 50px;
    animation-duration: 13s;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    left: 50%;
    width: 30px;
    height: 30px;
    animation-duration: 10s;
    animation-delay: 0s;
}

.bubble:nth-child(5) {
    left: 65%;
    width: 60px;
    height: 60px;
    animation-duration: 12s;
    animation-delay: 3s;
}

.bubble:nth-child(6) {
    left: 80%;
    width: 35px;
    height: 35px;
    animation-duration: 9s;
    animation-delay: 1s;
}

.bubble:nth-child(7) {
    left: 90%;
    width: 45px;
    height: 45px;
    animation-duration: 14s;
    animation-delay: 2s;
}

@keyframes rise {
    0% {
        bottom: -100px;
        transform: translateX(0);
    }

    50% {
        transform: translateX(100px);
    }

    100% {
        bottom: 1080px;
        transform: translateX(-200px);
    }
}

/* Header */
header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 10px 20px;
    background: rgba(29, 29, 29, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 5px solid var(--gold);
    animation: slideDown 1s ease-out;
}

.logo {
    width: 6% !important;
    max-width: 80px;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.logo-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 5rem;
    color: var(--crab-red);
    text-shadow: 3px 3px 0 var(--gold), 6px 6px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 8px;
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

.logo-title .crab-a {
    display: inline-block;
    color: var(--gold);
    transform: scale(1.3);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes glow {
    from {
        text-shadow: 3px 3px 0 var(--gold), 6px 6px 10px rgba(0, 0, 0, 0.5);
    }

    to {
        text-shadow: 3px 3px 0 var(--gold), 6px 6px 20px var(--crab-red), 9px 9px 30px var(--gold);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1.3) translateY(0);
    }

    50% {
        transform: scale(1.3) translateY(-10px);
    }
}

.subtitle {
    font-family: 'Russo One', sans-serif;
    font-size: 1.5rem;
    color: var(--gold);
    letter-spacing: 3px;
}

/* Realistic Crab Mascot */
.crab-mascot {
    position: fixed;
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.5s ease;
    font-size: 3rem;
    filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.5));
    animation: crabFloat 4s ease-in-out infinite;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    font-size: 2.7rem !important;
}

@keyframes crabFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(-2deg);
    }

    50% {
        transform: translateY(-5px) rotate(2deg);
    }

    75% {
        transform: translateY(-15px) rotate(-1deg);
    }
}

/* 🦀 Container that stays fixed */
#crab-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    overflow: visible;
    pointer-events: none;
    z-index: 9999;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}


#crabimg {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: crabWalk 16s linear infinite;
    animation-play-state: running;
}


#crabimg:hover {
    animation-play-state: paused;
}

#crabimg:hover .crapimage {
    animation-play-state: paused;
}


img.img-fluid.crapimage {
    width: 145px;
    height: auto;
    cursor: pointer;
    pointer-events: auto;
    z-index: 10000;
    animation: crabFlip 16s linear infinite;
    animation-play-state: running;
}

.speech-bubble {
    position: absolute;
    bottom: 160px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 12px 18px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 1;
    min-width: 180px;
    font-family: 'Russo One', sans-serif;
    text-align: center;
    white-space: nowrap;
    z-index: 10001;
}

@keyframes crabWalk {
    0% {
        right: 0;
    }

    49% {
        right: calc(100% - 160px);
    }

    50% {
        right: calc(100% - 160px);
    }

    99% {
        right: 0;
    }

    100% {
        right: 0;
    }
}

@keyframes crabFlip {

    0%,
    49% {
        transform: scaleX(1);
    }

    50%,
    100% {
        transform: scaleX(-1);
    }
}


@media (max-width: 768px) {

    #crabimg,
    .crapimage {
        animation: none !important;

    }
}

/* 💬 Show (no bounce, smooth fade only) */
.speech-bubble.show {
    opacity: 1;
}

/* 💬 Bubble tail */
.speech-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 60%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(255, 255, 255, 0.9);
}


/* 🦀 Click bounce */
/* .crapimage.clicked {
    transform: scale(1.1);
    transition: transform 0.3s ease;
} */




@keyframes bubbleBounce {
    0% {
        transform: translateX(-50%) scale(0);
    }

    50% {
        transform: translateX(-50%) scale(1.1);
    }

    100% {
        transform: translateX(-50%) scale(1);
    }
}



/* Main Content */
main {
    position: relative;
    z-index: 5;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

section {
    background: rgba(29, 29, 29, 0.9);
    margin: 40px 0;
    padding: 50px;
    border-radius: 20px;
    border: 3px solid var(--gold);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
    animation-fill-mode: both;
}

section:nth-child(1) {
    animation-delay: 0.2s;
}

section:nth-child(2) {
    animation-delay: 0.4s;
}

section:nth-child(3) {
    animation-delay: 0.6s;
}

section:nth-child(4) {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    font-family: 'Anton', sans-serif;
    font-size: 3rem;
    color: var(--crab-red);
    text-shadow: 2px 2px 0 var(--gold);
    margin-bottom: 30px;
    letter-spacing: 3px;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--crab-red) 100%);
    animation: expand 1s ease-out;
}

@keyframes expand {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

h3 {
    font-family: 'Russo One', sans-serif;
    font-size: 1.5rem;
    color: var(--gold);
    margin: 25px 0 15px;
}

p,
li {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* Crab Types */
.crab-types {
    display: grid;



    
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.crab-type {
    background: linear-gradient(135deg, var(--crab-red) 0%, #ff6b6b 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.crab-type::before {
    content: '🦀';
    position: absolute;
    font-size: 8rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.crab-type:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 15px 40px rgba(230, 57, 70, 0.6);
}

.crab-type:hover::before {
    opacity: 0.6;
    transform: translate(-50%, -50%) rotate(180deg);
}

.crab-type h3 {
    position: relative;
    z-index: 1;
}

.crab-type p {
    position: relative;
    z-index: 1;
}

/* Rules List */
.rules-list {
    counter-reset: rule-counter;
    list-style: none;
    padding: 0 !important;
}

.rules-list li {
    counter-increment: rule-counter;
    position: relative;
    padding-left: 60px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.rules-list li:hover {
    transform: translateX(10px);
    color: var(--gold);
}

.rules-list li::before {
    content: counter(rule-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--gold) 0%, #ffed4e 100%);
    color: var(--black);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    background: rgba(29, 29, 29, 0.95);
    border-top: 3px solid var(--gold);
    position: relative;
    z-index: 10;
}

footer p {
    font-family: 'Russo One', sans-serif;
    color: var(--gold);
    font-size: 1.1rem;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--crab-red) 0%, var(--gold) 100%);
    border-radius: 5px;
    animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
    }

    50% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

/* Locator Section */
.locator-form {
    background: linear-gradient(135deg, var(--crab-red) 0%, #ff4757 100%);
    padding: 40px;
    border-radius: 15px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(230, 57, 70, 0.4);
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-family: 'Russo One', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--white);
}

input,
select {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: 3px solid var(--gold);
    border-radius: 10px;
    background: var(--white);
    color: var(--black);
    font-weight: bold;
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--ocean-blue);
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(69, 123, 157, 0.5);
}

.search-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.5rem;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 2px;
    background: var(--gold);
    color: var(--black);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.search-btn:hover::before {
    width: 300px;
    height: 300px;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.6);
}

.search-btn span {
    position: relative;
    z-index: 1;
}

/* Results */
.results {
    margin-top: 30px;
    padding: 30px;
    background: rgba(69, 123, 157, 0.3);
    border-radius: 15px;
    border: 3px solid var(--ocean-blue);
    display: none;
}

.results.show {
    display: block;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.result-item {
    background: rgba(29, 29, 29, 0.8);
    padding: 20px;
    margin: 15px 0;
    border-radius: 10px;
    border-left: 5px solid var(--gold);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateX(10px);
    border-left-width: 10px;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.result-item h4 {
    color: var(--gold);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

/* Scroll Progress Bar */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 17px;
    background: rgba(29, 29, 29, 0.8);
    z-index: 1001;
    border-bottom: 2px solid var(--gold);
    border-top: 2px solid var(--gold);
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--crab-red) 0%, var(--gold) 100%);
    position: relative;
    transition: width 0.3s ease;
    border-radius: 0 5px 5px 0;
}

.scroll-crab {
    position: absolute;
    right: -20px;
    top: -15px;
    font-size: 2rem;
    transform: scaleX(-1);
    transition: left 0.3s ease;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.5));
    z-index: 1002;
}

/* Section highlighting */
section {
    transition: all 0.3s ease;
}

section.active {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    border-color: var(--crab-red);
}

/* ========== RESPONSIVE DESIGN ========== */

/* Large screens (desktops) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Medium screens (tablets) */
@media (max-width: 991px) {
    .logo {
        width: 10% !important;
    }

    h2 {
        font-size: 2.5rem;
    }

    .crab-mascot {
        font-size: 3.5rem !important;
    }

    section {
        padding: 40px 30px;
    }

    .locator-form {
        padding: 30px;
    }
}

/* Small screens (landscape phones) */
@media (max-width: 767px) {
    .logo {
        width: 15% !important;
    }

    .logo-title {
        font-size: 3.5rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .crab-mascot {
        font-size: 3rem !important;
    }

    section {
        padding: 30px 20px;
        margin: 30px 0;
    }

    .locator-form {
        padding: 25px;
    }

    .search-btn {
        font-size: 1.3rem;
        padding: 18px;
    }

    .crab-types {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .speech-bubble {
        font-size: 0.8rem;
        min-width: 150px;
        white-space: normal;
        max-width: 200px;
    }
}

/* Extra small screens (portrait phones) */
@media (max-width: 575px) {
    .logo {
        width: 20% !important;
    }

    .logo-title {
        font-size: 2.8rem;
        letter-spacing: 5px;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    .crab-mascot {
        font-size: 2.5rem !important;
    }

    section {
        padding: 25px 15px;
        margin: 20px 0;
    }

    .locator-form {
        padding: 20px;
    }

    .search-btn {
        font-size: 1.2rem;
        padding: 16px;
    }

    .rules-list li {
        padding-left: 50px;
        margin-bottom: 20px;
    }

    .rules-list li::before {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .speech-bubble {
        font-size: 0.75rem;
        min-width: 130px;
        max-width: 180px;
        padding: 10px 14px;
    }

    footer p {
        font-size: 1rem;
    }

    .scroll-crab {
        font-size: 1.5rem;
        top: -10px;
        right: -15px;
    }

    #bannerimage {
        height: 40vh !important;
        object-fit: cover;
    }
}

/* Very small screens (small phones) */
@media (max-width: 400px) {
    .logo {
        width: 25% !important;
    }

    .logo-title {
        font-size: 2.2rem;
        letter-spacing: 3px;
    }

    .subtitle {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    p,
    li {
        font-size: 1rem;
    }

    .crab-mascot {
        font-size: 2rem !important;
    }

    section {
        padding: 20px 12px;
    }

    .locator-form {
        padding: 18px;
    }

    input,
    select {
        padding: 12px;
        font-size: 1rem;
    }

    .search-btn {
        font-size: 1.1rem;
        padding: 14px;
    }

    .crab-types {
        gap: 15px;
    }

    .crab-type {
        padding: 20px;
    }

    .crab-type::before {
        font-size: 6rem;
    }

    .rules-list li {
        padding-left: 45px;
    }

    .rules-list li::before {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }

    .speech-bubble {
        font-size: 0.7rem;
        min-width: 120px;
        max-width: 160px;
        padding: 8px 12px;
    }

    #bannerimage {
        height: 40vh !important;
        object-fit: cover;
    }
}

/* Fix for very tall screens */
@media (min-height: 1000px) {
    .bubbles {
        height: 120vh;
    }

    @keyframes rise {
        0% {
            bottom: -100px;
            transform: translateX(0);
        }

        50% {
            transform: translateX(100px);
        }

        100% {
            bottom: 1300px;
            transform: translateX(-200px);
        }
    }
}

/* Fix for very wide screens */
@media (min-width: 1600px) {
    main {
        max-width: 1400px;
    }

    .container {
        max-width: 1300px;
    }
}

/* Print styles */
@media print {

    .bubbles,
    .crab-mascot,
    .scroll-progress-container,
    .search-btn {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    section {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }

    h2 {
        color: black !important;
        text-shadow: none !important;
    }

    h2::after {
        background: black !important;
    }
}

/* Map Container - FIXED */
.map-container {
    width: 100%;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

#map {
    width: 100%;
    height: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    #map {
        height: 350px;
    }

    section {
        padding: 30px 20px;
    }

    h2 {
        font-size: 2.2rem;
    }

    .locator-form {
        padding: 25px;
    }

    img.img-fluid.crapimage {
        width: 100px;
    }

    .speech-bubble {
        bottom: 120px;
        font-size: 0.8rem;
        min-width: 150px;
    }
}

@media (max-width: 575px) {
    #map {
        height: 300px;
    }

    section {
        padding: 25px 15px;
        margin: 20px 0;
    }

    h2 {
        font-size: 2rem;
    }

    .search-btn {
        font-size: 1.2rem;
        padding: 16px;
    }

    img.img-fluid.crapimage {
        width: 80px;
    }

    .speech-bubble {
        bottom: 100px;
        font-size: 0.75rem;
        min-width: 130px;
    }

    #bannerimage {
        height: 40vh !important;
        object-fit: cover;
    }
}