﻿/* Base and reset */
html {
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #1e7f3c;
    color: #222;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

body.dark-mode {
    background-color: #101820;
    color: #f5f5f5;
}

img {
    max-width: 100%;
}

.hidden {
    display: none !important;
}

/* Splash screen */
.splash-screen {
    position: fixed;
    inset: 0;
    background: rgba(11, 79, 42, 0.96);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.splash-card {
    background: white;
    padding: 36px;
    border-radius: 18px;
    text-align: center;
    width: min(420px, 90vw);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

.splash-card img {
    width: 90px;
    margin-bottom: 18px;
}

.spinner {
    width: 54px;
    height: 54px;
    margin: 24px auto 0;
    border: 6px solid #cfa14a;
    border-top-color: #0b4f2a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Slide transition animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100px);
    }
}

/* Header */
header {
    background-color: #0b4f2a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    gap: 18px;
    overflow-x: hidden;
    max-width: 100vw;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-block img {
    width: 72px;
    border-radius: 14px;
    background: white;
    padding: 10px;
}

.brand-block h1,
.brand-block p {
    margin: 0;
}

.theme-toggle {
    background: #cfa14a;
    border: none;
    color: #0b4f2a;
    font-weight: bold;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
}

.theme-toggle:hover {
    background: #d3b85a;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
    transition: all 0.3s ease;
}

.hamburger-btn.active {
    position: fixed;
    top: 15px;
    right: 15px;
}

.hamburger-btn span {
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s linear;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #cfa14a;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    padding: 80px 20px 30px;
}

.mobile-nav.active {
    display: block;
    transform: translateY(0);
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    margin: 15px 0;
}

.mobile-nav a {
    display: block;
    text-decoration: none;
    color: #0b4f2a;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 15px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.mobile-nav a:hover {
    background: rgba(11, 79, 42, 0.1);
}

/* Navigation */
nav {
    background-color: #cfa14a;
    padding: 12px 0;
    text-align: center;
    overflow-x: hidden;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav li {
    display: inline-block;
    margin: 0 16px;
}

nav a {
    text-decoration: none;
    color: #0b4f2a;
    font-weight: bold;
}

/* Main cards */
main {
    padding: 30px 20px 60px;
    transition: opacity 0.3s ease;
    overflow-x: hidden;
    max-width: 100%;
}

.card {
    background-color: #ffffff;
    margin: 20px auto;
    padding: 28px;
    width: min(1000px, 92%);
    max-width: 100%;
    border-radius: 20px;
    border: 5px solid #cfa14a;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.08);
    animation: slideInRight 0.5s ease-out forwards;
    overflow-x: hidden;
}

.card.hidden {
    display: none !important;
    animation: none;
}

body.dark-mode .card {
    background-color: #19221f;
    border-color: #46584d;
}

/* Section transitions */
#home, #position-menu, #quiz, #contact {
    transition: all 0.5s ease-out;
}

h2 {
    text-align: center;
    color: #0b4f2a;
    margin-top: 0;
}

body.dark-mode h2 {
    color: #dff1d7;
}

ul {
    padding-left: 0;
    list-style: none;
}

ul li {
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

body.dark-mode ul li {
    border-bottom-color: #2f3a35;
}

.hero-section {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    align-items: center;
}

.hero-copy p {
    max-width: 640px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
}

.primary-button,
.secondary-button,
.answer-button {
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-weight: bold;
    padding: 14px 20px;
}

.primary-button {
    background-color: #0b4f2a;
    color: white;
}

.primary-button:hover {
    background-color: #146b3a;
}

.secondary-button {
    background-color: #eae3d3;
    color: #0b4f2a;
}

.secondary-button:hover {
    background-color: #f3ecd9;
}

.hero-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    background: #f9f5e7;
    border-radius: 16px;
    padding: 18px;
    text-align: center;
}

body.dark-mode .stat-card {
    background: #25432c;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
    color: #0b4f2a;
}

body.dark-mode .stat-card strong {
    color: #cfcaa8;
}

.small-label {
    display: block;
    margin-bottom: 6px;
    color: #555;
}

body.dark-mode .small-label {
    color: #b0b5ac;
}

.question-card {
    display: grid;
    gap: 18px;
}

.question-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.question-top h2 {
    margin: 0;
    font-size: 1.4rem;
}

.answers {
    display: grid;
    gap: 12px;
}

.answer-button {
    background-color: #f7f2e8;
    color: #0b4f2a;
    text-align: left;
    width: 100%;
}

.answer-button:hover {
    background-color: #e8e1d4;
}

.answer-button.correct-answer {
    background-color: #d3f2d1;
    border: 2px solid #2d8c3b;
}

.answer-button.wrong-answer {
    background-color: #f7d6d6;
    border: 2px solid #b74141;
}

.feedback {
    border-radius: 14px;
    padding: 18px;
    font-weight: bold;
}

.feedback.correct {
    background-color: #daf2da;
    color: #24532a;
}

.feedback.incorrect {
    background-color: #f9d6d6;
    color: #6c1b1b;
}

.feedback.summary {
    background-color: #eef5f0;
    color: #1b4f25;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.position-button {
    background-color: #0b4f2a;
    color: white;
}

.position-button:hover {
    background-color: #146b3a;
}

form {
    display: grid;
    gap: 14px;
}

label {
    font-weight: bold;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #cfcaa8;
    border-radius: 12px;
    background: white;
    color: #222;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #1e2a24;
    color: #f1f1d7;
    border-color: #46584d;
}

footer {
    background-color: #0b4f2a;
    color: white;
    text-align: center;
    padding: 18px 20px;
    overflow-x: hidden;
    max-width: 100vw;
}

footer a {
    color: #f8f2d7;
    text-decoration: none;
}

/* Baseball Field Layout */
.baseball-field {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.field-image {
    width: 100%;
    height: auto;
    display: block;
    max-width: 600px;
}

.position-btn {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid white;
    background-color: #0b4f2a;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.position-btn:hover {
    background-color: #1e7f3c;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(30, 127, 60, 0.8), 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Position button placements on field image */
/* Pitcher - mound */
.pitcher-btn { 
    top: 60%; 
    left: 50%; 
    transform: translate(-50%, -50%);
}

/* Catcher - home plate */
.catcher-btn { 
    top: 78%; 
    left: 50%; 
    transform: translate(-50%, -50%);
}

/* First Base - right side of diamond */
.first-base-btn { 
    top: 58%; 
    left: 67%; 
    transform: translate(-50%, -50%);
}

/* Second Base - between first and second */
.second-base-btn { 
    top: 45%; 
    left: 60%; 
    transform: translate(-50%, -50%);
}

/* Third Base - left side of diamond */
.third-base-btn { 
    top: 58%; 
    left: 33%; 
    transform: translate(-50%, -50%);
}

/* Shortstop - between third and second */
.shortstop-btn { 
    top: 45%; 
    left: 40%; 
    transform: translate(-50%, -50%);
}

/* Left Field - left outfield */
.left-field-btn { 
    top: 31%; 
    left: 27%; 
    transform: translate(-50%, -50%);
}

/* Center Field - center outfield */
.center-field-btn { 
    top: 25%; 
    left: 50%; 
    transform: translate(-50%, -50%);
}

/* Right Field - right outfield */
.right-field-btn { 
    top: 31%; 
    left: 73%; 
    transform: translate(-50%, -50%);
}

/* Quiz Styles */
#question-display {
    margin: 20px 0;
}

#question-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f0f0f0;
    border-left: 5px solid #0b4f2a;
    border-radius: 5px;
}

body.dark-mode #question-text {
    background-color: #222;
    color: #f5f5f5;
}

#choices-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.choice-btn {
    padding: 12px 15px;
    background-color: #e8e8e8;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-align: left;
}

body.dark-mode .choice-btn {
    background-color: #333;
    border-color: #555;
    color: #f5f5f5;
}

.choice-btn:hover {
    background-color: #d0d0d0;
    border-color: #0b4f2a;
    box-shadow: 0 0 10px rgba(11, 79, 42, 0.3);
}

body.dark-mode .choice-btn:hover {
    background-color: #444;
}

#feedback-display {
    margin: 20px 0;
    padding: 15px;
    background-color: #daf2da;
    border-left: 5px solid #24532a;
    border-radius: 5px;
}

#feedback-display.correct {
    background-color: #daf2da;
    border-left-color: #24532a;
}

#feedback-display.incorrect {
    background-color: #f9d6d6;
    border-left-color: #b74141;
}

body.dark-mode #feedback-display {
    background-color: #1a4d1a;
    border-left-color: #7fb37f;
    color: #f5f5f5;
}

body.dark-mode #feedback-display.correct {
    background-color: #1a4d1a;
    border-left-color: #7fb37f;
    color: #f5f5f5;
}

body.dark-mode #feedback-display.incorrect {
    background-color: #4a1a1a;
    border-left-color: #ff6b6b;
    color: #f5f5f5;
}

#quiz-complete {
    text-align: center;
    padding: 30px;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin: 20px 0;
}

body.dark-mode #quiz-complete {
    background-color: #222;
    color: #f5f5f5;
}

.quiz-progress {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

body.dark-mode .quiz-progress {
    color: #aaa;
}

/* Form Styles */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background-color: #333;
    border-color: #555;
    color: #f5f5f5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0b4f2a;
    box-shadow: 0 0 8px rgba(11, 79, 42, 0.3);
}

#contact-form {
    max-width: 500px;
    margin: 20px auto;
}

@media (max-width: 840px) {
    .hero-section {
        grid-template-columns: 1fr;
    }

    .position-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    nav {
        display: none;
    }

    .hamburger-btn {
        display: flex;
    }

    .hero-details {
        grid-template-columns: 1fr;
    }

    .position-grid {
        grid-template-columns: 1fr;
    }

    main {
        padding: 30px 0 60px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .card {
        width: 100%;
        padding: 15px;
        border: none;
        margin: 10px 0;
        box-shadow: none;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .baseball-field {
        max-width: 100%;
        margin: 20px 0;
        overflow: hidden;
        padding: 0;
        width: 100%;
        position: relative;
    }

    .field-image {
        max-width: 100%;
        width: 100%;
        height: auto;
        display: block;
    }

    header {
        padding: 15px 5px;
        flex-wrap: wrap;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .brand-block {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        max-width: 100%;
    }

    .brand-block img {
        width: 50px;
        padding: 5px;
    }

    .brand-block h1 {
        font-size: 1.2rem;
    }

    .brand-block p {
        font-size: 0.8rem;
    }

    .theme-toggle {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .position-btn {
        width: 30px;
        height: 30px;
        font-size: 8px;
        border-width: 1px;
        transform: none;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions button {
        width: 100%;
        box-sizing: border-box;
    }

    ul li {
        padding: 8px 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    h2 {
        font-size: 1.3rem;
        word-wrap: break-word;
    }

    .card {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Adjust position button positions for mobile - more conservative to prevent overflow */
    .pitcher-btn {
        top: 58%;
        left: 46.5%;
    }

    .catcher-btn {
        top: 72%;
        left: 46.5%;
    }

    .first-base-btn {
        top: 56%;
        left: 60%;
    }

    .second-base-btn {
        top: 43%;
        left: 55%;
    }

    .third-base-btn {
        top: 56%;
        left: 35%;
    }

    .shortstop-btn {
        top: 43%;
        left: 38%;
    }

    .left-field-btn {
        top: 29%;
        left: 25%;
    }

    .center-field-btn {
        top: 23%;
        left: 46.5%;
    }

    .right-field-btn {
        top: 29%;
        left: 68%;
    }
}
