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

body {
    font-family: 'Helvetica', sans-serif;
    overflow-x: hidden; /* Prevent horizontal scroll */
    background-color: #0c0c0c; /* Set base background for consistency */
        cursor: url('assets/anchor.png'), auto;
    cursor: url('assets/anchor.png') 4 4, auto;

}

button, .nav-item {
    cursor: url('assets/anchor.png') 4 4, pointer;
}

#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.title {
    font-family: 'Pacifico', cursive;
    font-size: 2.5rem;
    color: #333;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    display: inline-block;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.3); /* Transparent background */
    backdrop-filter: blur(10px); /* Apply blur effect */
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    padding: 15px 0;
    text-align: center;
    z-index: 10;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

.nav-item {
    margin: 0 12px;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 10px 20px;
    border: none;
    background: #d0f0ff;
    border-radius: 8px;
    cursor: pointer;
    color: #003f5c;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    background: linear-gradient(to bottom, #d0f0ff, #a2dbfa);
}

.nav-item:active {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Clue Indicators Styles */
.clue-indicators {
    position: fixed;
    top: 80px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 20;
}

.clue-icon {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    font-size: 1.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0.3;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.clue-icon.found {
    opacity: 1;
    transform: scale(1);
    background: rgba(255, 255, 255, 0.95);
    animation: pulse 2s infinite;
}

.clue-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.country-page {
    display: none;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
    z-index: 1;
    width: 80%;
    max-width: 800px;
    animation: fadeIn 0.6s ease-out;
}

.country-img {
    width: 500px;
    max-width: 100%;
    border-radius: 20px;
    display: block;
    margin: 0 auto 20px auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Combined audio controls styling */
.audio-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.7);
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

.audio-controls .play-btn {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(to bottom right, #ff8a5b, #ff5f6d);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

.audio-controls .play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* FIXED STYLING FOR p5 BACKGROUND */
#background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.audio-controls .progress-bar {
    width: 300px;
    height: 10px;
    border-radius: 5px;
    background: #eee;
    appearance: none;
    cursor: pointer;
    transition: height 0.3s ease;
    margin: 0;
    display: inline-block;
}

.audio-controls .progress-bar:hover {
     height: 12px;
}

/* Styles for progress bar thumb (cross-browser) */
.audio-controls .progress-bar::-webkit-slider-thumb {
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #ff6b81;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    margin-top: -5px;
}
.audio-controls .progress-bar::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #ff6b81;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.audio-controls .progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.audio-controls .progress-bar::-moz-range-thumb:hover {
     transform: scale(1.2);
}

.audio-controls .speed-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(to bottom, #fff, #f0f0f0);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-size: 1rem;
    margin: 0;
}

.audio-controls .speed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.subtitle-container {
  margin-top: 20px;
  font-size: 1.2rem;
  color: #333;
  font-weight: 500;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  padding: 16px 20px;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  line-height: 1.5;
  display: none;
}

.subtitle-container p {
    font-size: 1.2rem;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

/* Landing Page Adjustments */
#landing-page {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pirate-scene {
    display: flex;
    align-items: center;
    gap: 30px;
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.pirate-img {
    height: 300px;
    animation: sway 5s infinite ease-in-out;
    transition: transform 0.5s ease;
    max-width: none;
    box-shadow: none;
    margin: 0;
    border-radius: 0;
}

.pirate-img:hover {
    animation: bounce 0.5s infinite alternate;
}

.speech-bubble {
    padding: 25px 28px;
    background: #fff;
    border-radius: 25px;
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.35);
    font-size: 1.25rem;
    line-height: 1.6;
    position: relative;
    transform-origin: left center;
    max-width: 450px;
    width: 450px;
    min-height: 90px;
    animation: bubblePop 0.6s ease-in-out;
}

.speech-bubble::after {
    content: "";
    position: absolute;
    top: 45px;
    left: -20px;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-right-color: #fff;
}

.landing-buttons {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    text-align: center;
    animation: fadeInUp 1s ease 0.5s both;
}

/* Adventure Progress Bar Styles - REDUCED SIZE BY 30% */
.adventure-progress {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 63%; /* Reduced by 30% from 90% */
    max-width: 490px; /* Reduced by 30% from 700px */
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
    text-align: center;
}

.progress-label {
    font-size: 1rem; /* Slightly reduced */
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.progress-track {
    height: 8px; /* Reduced from 10px */
    background: #ddd;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px; /* Reduced from 12px */
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #ff7f50, #ff5f6d);
    border-radius: 5px;
    transition: width 0.8s ease;
}

.progress-countries {
    display: flex;
    justify-content: space-around;
    padding: 0 5%;
}

.country-dot {
    width: 30px; /* Reduced from 40px */
    height: 30px; /* Reduced from 40px */
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem; /* Reduced from 1.5rem */
    position: relative;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.country-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    width: 100%;
    max-width: 100px; /* Reduced from 120px */
    height: 2px;
    background: #ddd;
    z-index: -1;
}

.country-dot:last-child::after {
    display: none;
}

.country-dot.active {
    opacity: 1;
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.country-dot.visited {
    opacity: 1;
    background: rgba(255, 255, 255, 0.9);
}

.country-dot.visited::after {
    background: #ff7f50;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes float {
    0% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
    100% { transform: translateX(-50%) translateY(0); }
}

@keyframes sway {
    0% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
    100% { transform: rotate(-2deg); }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

@keyframes bubblePop {
    0% { transform: scale(0.5) translateX(-50%); opacity: 0; }
    50% { transform: scale(1.1) translateX(-50%); }
    100% { transform: scale(1) translateX(-50%); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 127, 80, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 127, 80, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 127, 80, 0); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .title {
        font-size: 1.8rem;
        padding: 10px 20px;
        top: 65px;
    }

    .navbar {
         padding: 10px 0;
    }

    .nav-item {
        margin: 0 5px;
        font-size: 1rem;
        padding: 8px 12px;
    }

    .clue-indicators {
        top: 65px;
        left: 10px;
        gap: 10px;
    }

    .clue-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .pirate-scene {
        flex-direction: column;
        gap: 15px;
        top: 40%;
        align-items: center;
    }
    
    .pirate-img {
        height: 180px; /* Further reduced for mobile */
        animation: sway 5s infinite ease-in-out;
        transition: transform 0.5s ease;
        flex-shrink: 0;
    }

    .speech-bubble {
        font-size: 1rem;
        padding: 15px;
        max-width: 80vw;
    }

    .speech-bubble::after {
        top: -20px;
        left: 50%;
        transform: translateX(-50%);
        border: 15px solid transparent;
        border-bottom-color: #fff;
        border-right-color: transparent;
    }

    .landing-buttons {
        top: 78%;
    }

    .audio-controls {
        gap: 10px;
        padding: 10px 15px;
    }

    .audio-controls .progress-bar {
        width: 200px;
    }

    .adventure-progress {
        max-width: 80%;
        padding: 10px;
    }

    .country-dot {
        width: 25px; /* Further reduced */
        height: 25px; /* Further reduced */
        font-size: 1rem;
    }
    
    .country-dot::after {
        max-width: 60px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
        padding: 8px 15px;
        top: 60px;
    }
    
    .navbar {
        padding: 8px 0;
    }
    
    .nav-item {
        margin: 0 3px;
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .clue-indicators {
        top: 55px;
        left: 5px;
        gap: 8px;
    }

    .clue-icon {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }

    .pirate-img {
        height: 150px;
    }

    .speech-bubble {
        font-size: 0.9rem;
        padding: 10px;
    }

    .subtitle-container p, .subtitle-container {
        font-size: 0.9rem;
        padding: 10px 15px;
    }

    .audio-controls .progress-bar {
        width: 150px;
    }

    .country-dot {
        width: 22px; /* Further reduced */
        height: 22px; /* Further reduced */
        font-size: 0.9rem;
    }
    
    .country-dot::after {
        max-width: 40px;
    }

    .adventure-progress {
        bottom: 10px;
    }
}



/* Add to style.css */
#compass-container {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    z-index: 50;
}

.compass-base {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.compass-arrow {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 4px;
    height: 25px;
    background: #ff3333;
    transform-origin: bottom center;
    transform: translateX(-50%);
}

.compass-arrow::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #ff3333;
}

/* Add to style.css */
#journal-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: transform 0.3s ease;
}

#journal-icon:hover {
    transform: scale(1.1);
}

#journal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.journal-content {
    background: url('assets/paper-texture.jpg'), #f5e9dc;
    background-size: cover;
    width: 80%;
    max-width: 600px;
    height: 70%;
    max-height: 700px;
    border-radius: 10px;
    padding: 30px;
    position: relative;
    font-family: 'Pacifico', cursive;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.journal-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #5d4037;
}

#journal-entries {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    font-family: 'Pacifico', cursive;
    color: #333;
    line-height: 1.6;
}

.journal-entry {
    border-bottom: 1px solid #d7ccc8;
    padding: 10px 0;
    margin-bottom: 10px;
}

.journal-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#journal-input {
    flex: 1;
    min-height: 60px;
    padding: 10px;
    border: 1px solid #d7ccc8;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.5);
    font-family: 'Pacifico', cursive;
}

#journal-save {
    padding: 10px 15px;
    background: #795548;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Pacifico', cursive;
}

#journal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #5d4037;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

/* Add to style.css */
#pirate-character-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}


