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

body {
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    background-color: #1a1a1a;
    color: #ffffff;
    overflow-x: hidden;
}

/* General Heading Styles */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    font-weight: bold;
}

/* Page Background Images */
.introduction-page {
    position: relative;
}

.introduction-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Images/floral1.avif');
    background-repeat: repeat;
    background-position: 0 0;
    background-size: auto;
    opacity: 0.7;
    z-index: -1;
    pointer-events: none;
}

.haiku-page {
    position: relative;
}

.haiku-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Images/floral2.avif');
    background-repeat: repeat;
    background-position: 0 0;
    background-size: auto;
    z-index: -1;
    pointer-events: none;
}

.gallery-page {
    position: relative;
}

.gallery-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Images/floral3.jpg');
    background-repeat: repeat;
    background-position: 0 0;
    background-size: auto;
    z-index: -1;
    pointer-events: none;
}

.dear-buck-page {
    position: relative;
}

.dear-buck-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Images/floral4.avif');
    background-repeat: repeat;
    background-position: 0 0;
    background-size: auto;
    z-index: -1;
    pointer-events: none;
}

body.game-cursor {
    cursor: url('Images/pnbuck1.png') 24 24, auto !important;
}

body.game-cursor * {
    cursor: url('Images/pnbuck1.png') 24 24, auto !important;
}

/* Main Page Styles */
.main-page {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

/* Scrolling Collage */
.collage-container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0.3;
}

.collage-row {
    display: flex;
    width: 200%;
    height: 33.33%;
    white-space: nowrap;
}

.collage-row img {
    width: 400px;
    height: 100%;
    object-fit: cover;
    border: 2px solid #ffffff;
    opacity: 0.8;
    flex-shrink: 0;
}

.row-left {
    animation: scroll-left 25s linear infinite;
}

.row-right {
    animation: scroll-right 30s linear infinite;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes scroll-right {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Center Content */
.center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background-color: rgba(26, 26, 26, 0.7);
    padding: 40px 60px;
    border: 3px solid #ffffff;
    border-radius: 10px;
}

.main-title {
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    font-size: 4.5rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    font-style: italic;
}

.hop-button {
    display: inline-block;
    padding: 15px 40px;
    background-color: #2a2a2a;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid #ffffff;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
}

.hop-button:hover {
    background-color: #3a3a3a;
    transform: scale(1.05);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: #1a1a1a;
    border-bottom: 2px solid #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-tabs-center {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex: 1;
}

.exit-tab {
    padding: 12px 30px;
    background-color: #2a2a2a;
    color: #ffffff;
    text-decoration: none;
    border: 2px solid #ffffff;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
}

.exit-tab:hover {
    background-color: #3a3a3a;
    transform: translateY(-2px);
}

.nav-tab {
    padding: 12px 30px;
    background-color: #2a2a2a;
    color: #ffffff;
    text-decoration: none;
    border: 2px solid #ffffff;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
}

.nav-tab:hover {
    background-color: #3a3a3a;
    transform: translateY(-2px);
}

.nav-tab.active {
    background-color: #4a4a4a;
}

.draw-tab {
    cursor: pointer;
    border: none;
}

/* Introduction Page */
.intro-container {
    display: flex;
    min-height: calc(100vh - 80px);
    padding: 40px;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.portrait-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portrait-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border: 4px solid #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.text-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.text-editable {
    background-color: #2a2a2a;
    color: #ffffff;
    padding: 30px;
    border: 3px solid #ffffff;
    border-radius: 10px;
    min-height: 400px;
    font-size: 1.2rem;
    line-height: 1.8;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    resize: vertical;
    width: 100%;
}

.text-editable:focus {
    outline: none;
    border-color: #cccccc;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.intro-text {
    background-color: #2a2a2a;
    color: #ffffff;
    padding: 30px;
    border: 3px solid #ffffff;
    border-radius: 10px;
    min-height: 400px;
    font-size: 1.2rem;
    line-height: 1.8;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    width: 100%;
    white-space: pre-line;
}

.portrait-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border: 4px solid #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.portrait-image.fade-out {
    opacity: 0;
}

.portrait-image.fade-in {
    opacity: 1;
}

/* Gallery Page */
.gallery-container {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gallery-header h1 {
    background-color: rgba(42, 42, 42, 0.9);
    border: 3px solid #ffffff;
    border-radius: 10px;
    padding: 20px 40px;
    display: inline-block;
}

.draw-for-buck-button {
    padding: 12px 30px;
    background-color: #2a2a2a;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
}

.draw-for-buck-button:hover {
    background-color: #3a3a3a;
    transform: translateY(-2px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border: 3px solid #ffffff;
    border-radius: 10px;
    background-color: #2a2a2a;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Image View Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.show {
    opacity: 1;
}

.close-image-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    font-weight: bold;
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
    z-index: 2001;
}

.close-image-modal:hover {
    color: #cccccc;
    transform: scale(1.2);
}

.modal-image {
    display: block;
    margin: 50px auto;
    max-width: 90%;
    max-height: 90vh;
    border: 3px solid #ffffff;
    border-radius: 10px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.image-modal.show .modal-image {
    opacity: 1;
    transform: scale(1);
}

/* Haiku Page */
.haiku-container {
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.haiku-section {
    background-color: #2a2a2a;
    border: 3px solid #ffffff;
    border-radius: 10px;
    padding: 40px;
    margin: 30px 0;
    min-height: 200px;
}

.haiku-section h2 {
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffffff;
    font-style: italic;
}

.haiku-text {
    font-size: 1.3rem;
    line-height: 2;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    color: #ffffff;
    white-space: pre-line;
}

.generate-haiku-button {
    display: block;
    margin: 0 auto 30px auto;
    padding: 15px 40px;
    background-color: #2a2a2a;
    color: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 5px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
}

.generate-haiku-button:hover {
    background-color: #3a3a3a;
    transform: scale(1.05);
}

.generate-haiku-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.haiku-display-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.haiku-image-container {
    flex: 0 0 auto;
}

.haiku-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border: 3px solid #ffffff;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 2s ease-in;
}

.haiku-image.show {
    opacity: 1;
}

.haiku-text-container {
    flex: 1;
    min-width: 300px;
}

.haiku-text-display {
    font-size: 1.5rem;
    line-height: 2.5;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    color: #ffffff;
    white-space: pre-line;
    min-height: 200px;
    padding: 20px;
    background-color: #1a1a1a;
    border: 2px solid #ffffff;
    border-radius: 5px;
}

.haiku-text-display .typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.5em;
    background-color: #ffffff;
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Dear Buck Page */
.dear-buck-container {
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.dear-buck-section {
    background-color: #2a2a2a;
    border: 3px solid #ffffff;
    border-radius: 10px;
    padding: 40px;
    margin: 30px 0;
    min-height: 400px;
}

.dear-buck-section h2 {
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 30px;
    color: #ffffff;
    text-align: center;
    font-style: italic;
}

.dear-buck-text {
    font-size: 1.2rem;
    line-height: 1.8;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    color: #ffffff;
    white-space: pre-line;
}

.dear-buck-text .typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.5em;
    background-color: #ffffff;
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-left: 2px;
}

/* Draw for Buck Modal */
.draw-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.draw-modal.show {
    opacity: 1;
}

.draw-modal-content {
    background-color: #2a2a2a;
    margin: 5% auto;
    padding: 30px;
    border: 3px solid #ffffff;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    position: relative;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.draw-modal.show .draw-modal-content {
    opacity: 1;
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #cccccc;
    transform: scale(1.2);
}

.drawing-section {
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.draw-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #1a1a1a;
    border: 2px solid #ffffff;
    border-radius: 5px;
}

.color-palette {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.color-palette label {
    font-size: 1rem;
    color: #ffffff;
}

.color-palette input[type="color"] {
    width: 50px;
    height: 50px;
    border: 2px solid #ffffff;
    border-radius: 5px;
    cursor: pointer;
}

.color-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border: 2px solid #ffffff;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.2);
}

.brush-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.brush-controls label {
    font-size: 1rem;
    color: #ffffff;
}

.brush-controls input[type="range"] {
    width: 150px;
    cursor: pointer;
}

.tool-button {
    padding: 10px 20px;
    background-color: #3a3a3a;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
}

.tool-button:hover {
    background-color: #4a4a4a;
    transform: translateY(-2px);
}

.tool-button.active {
    background-color: #5a5a5a;
}

#drawCanvas {
    border: 3px solid #ffffff;
    border-radius: 5px;
    background-color: #ffffff;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.give-button {
    margin-top: 20px;
    padding: 15px 40px;
    background-color: #2a2a2a;
    color: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 5px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
}

.give-button:hover {
    background-color: #3a3a3a;
    transform: scale(1.05);
}

.result-section {
    text-align: center;
    padding: 20px;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

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

.result-images {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.buck-result-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border: 3px solid #ffffff;
    border-radius: 10px;
}

.drawing-result-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border: 3px solid #ffffff;
    border-radius: 10px;
}

.buck-message {
    background-color: #1a1a1a;
    border: 3px solid #ffffff;
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
    font-size: 1.5rem;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    color: #ffffff;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.draw-again-button {
    margin-top: 20px;
    padding: 15px 40px;
    background-color: #2a2a2a;
    color: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
}

.draw-again-button:hover {
    background-color: #3a3a3a;
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 3rem;
    }

    .center-content {
        padding: 30px 40px;
    }

    .intro-container {
        flex-direction: column;
        padding: 20px;
    }

    .nav-tabs {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-tab {
        padding: 10px 20px;
        font-size: 1rem;
    }

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

    .draw-modal-content {
        width: 95%;
        padding: 20px;
        margin: 2% auto;
    }

    #drawCanvas {
        width: 100%;
        height: auto;
    }

    .draw-tools {
        flex-direction: column;
        gap: 15px;
    }

    .nav-tabs-center {
        flex-wrap: wrap;
    }
}

/* Cheerio Game Styles */
.hidden-cheerio {
    transition: opacity 0.5s ease;
}

.hidden-cheerio:hover {
    opacity: 1 !important;
    transform: scale(1.2);
}

.cheerio-game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.cheerio-game-modal.show {
    opacity: 1;
}

.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    z-index: 10001;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.cheerio-counter {
    font-size: 1.5rem;
    color: #ffffff;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    background-color: rgba(42, 42, 42, 0.8);
    padding: 10px 20px;
    border: 2px solid #ffffff;
    border-radius: 5px;
}

.game-timer {
    font-size: 1.5rem;
    color: #ffffff;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    background-color: rgba(42, 42, 42, 0.8);
    padding: 10px 20px;
    border: 2px solid #ffffff;
    border-radius: 5px;
}

.game-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.game-cheerio {
    position: absolute;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10002;
    transition: opacity 0.3s ease, transform 0.2s ease;
    pointer-events: auto;
}

.game-cheerio:hover {
    transform: scale(1.3);
}

.game-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10003;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.game-result h2 {
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    font-size: 3rem;
    font-weight: bold;
    font-style: italic;
    color: #ffffff;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.reward-button {
    padding: 15px 40px;
    background-color: #2a2a2a;
    color: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 5px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Times', 'Times New Roman', 'Garamond', 'Baskerville', serif;
    margin-top: 20px;
}

.reward-button:hover {
    background-color: #3a3a3a;
    transform: scale(1.05);
}

.reward-video {
    margin-top: 30px;
    max-width: 800px;
    width: 90%;
    border: 3px solid #ffffff;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 1s ease;
}

.reward-video.show {
    opacity: 1;
}
