/* Base styles */
html, body {
    height: 100%;
    margin: 0;
    font-family: "Garamond", "Times New Roman", serif;
    font-weight: bold;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fa;
    color: #333;
}

/* ========================================
   NAVIGATION BAR STYLES
   ======================================== */

/* Navigation bar styling */
.nav-bar {
    position: fixed;
    top: -200px; /* Start hidden well above the viewport */
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    color: white;
    padding: 15px 0;
    transition: top 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.nav-bar.show {
    top: 0; /* Slide down to show */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-brand:hover {
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 5px;
}

.nav-link:hover {
    color: white;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px solid white;
}

/* Navbar toggle icon */
.nav-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.nav-toggle .bar {
    width: 20px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Main content area */
.main-content {
    padding-top: 0; /* No padding needed since nav is fixed */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================
   FOOTER STYLES
   ======================================== */

footer {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    margin-top: auto;
}

footer p {
    margin: 0;
    font-size: 1rem;
}

footer div {
    margin-top: 15px;
}

footer a {
    color: white;
    margin: 0 10px;
    font-size: 1.5rem;
    text-decoration: none;
}

/* ========================================
   ANAGRAM GAME STYLES
   ======================================== */

.scrabble-container {
    padding: 40px 20px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    min-height: 100vh;
}

.scrabble-title {
    text-align: center;
    color: white;
    font-size: 3rem;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.letter-count-selector {
    text-align: center;
    margin-bottom: 30px;
}

.letter-count-dropdown {
    background: white;
    border: 2px solid #8B4513;
    border-radius: 10px;
    padding: 10px;
    font-size: 1rem;
    color: #2F4F4F;
    cursor: pointer;
    transition: all 0.3s ease;
}

.letter-count-dropdown:focus {
    outline: none;
    border-color: #20c997;
    box-shadow: 0 0 10px rgba(32, 201, 151, 0.3);
}

.letter-count-label {
    color: white;
    font-size: 1.2rem;
    margin-right: 10px;
}

.game-controls {
    text-align: center;
    margin-top: 40px;
}

.play-button {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.score-section {
    text-align: center;
    margin: 20px auto;
    max-width: 600px;
}

.score-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.total-score {
    font-size: 2rem;
    font-weight: bold;
    color: #2F4F4F;
    margin-bottom: 10px;
}

.round-score {
    font-size: 1.2rem;
    color: #20c997;
    font-weight: bold;
    margin-bottom: 10px;
}

.message {
    font-size: 1.1rem;
    color: #2F4F4F;
    margin-bottom: 10px;
}

.scoring-section {
    margin: 30px auto;
    max-width: 800px;
}

.scoring-header {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.scoring-header:hover {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.scoring-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
}

.scoring-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.scoring-icon.expanded {
    transform: rotate(180deg);
}

.scoring-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 10px 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.scoring-content.expanded {
    max-height: 500px;
    padding: 20px;
}

.scoring-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #2F4F4F;
    text-align: left;
}

.dealt-tiles-section {
    text-align: center;
    margin: 30px auto;
    max-width: 1200px;
}

.dealt-tiles-title {
    color: white;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.dealt-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.dealt-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.dealt-tile-letter {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 2px;
}

.dealt-tile-points {
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    position: absolute;
    bottom: 5px;
    right: 5px;
}

/* Anagram Game Responsive Design */
@media (max-width: 768px) {
    .dealt-tiles-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
    }

    .dealt-tile-letter {
        font-size: 1.5rem;
    }

    .dealt-tile-points {
        font-size: 0.7rem;
    }

    .scrabble-title, .dealt-tiles-title {
        font-size: 2rem;
    }

    .word-input {
        width: 250px;
    }

    .letter-count-selector {
        margin-bottom: 20px;
    }

    .letter-count-dropdown {
        padding: 8px;
        font-size: 0.9rem;
    }

    .total-score {
        font-size: 1.5rem;
    }

    .round-score {
        font-size: 1rem;
    }

    .message {
        font-size: 1rem;
    }

    .scoring-header {
        padding: 12px 15px;
    }

    .scoring-title {
        font-size: 1.1rem;
    }

    .scoring-icon {
        font-size: 1.3rem;
    }

    .scoring-text {
        font-size: 1rem;
    }
}

/* ========================================
   TETRIS GAME STYLES
   ======================================== */

.game-area {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin: 20px auto;
    max-width: 1200px;
}

.instructions {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-width: 250px;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions ul {
    text-align: left;
    color: #2c3e50;
    line-height: 1.6;
}

.instructions li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.game-board {
    border: 3px solid #ecf0f1;
    border-radius: 10px;
    background: #2c3e50;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.game-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 200px;
}

.info-section {
    margin-bottom: 20px;
}

.info-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.info-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
}

.controls {
    margin-top: 20px;
    text-align: center;
}

.control-button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.control-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Tetris Game Responsive Design */
@media (max-width: 768px) {

    .game-area {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .game-info {
        min-width: 150px;
    }

    .info-value {
        font-size: 1.2rem;
    }

    .control-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .instructions {
        max-width: 100%;
        margin: 10px 0;
    }
}

/* ========================================
   MINE SWEEPER GAME STYLES
   ======================================== */

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mine-counter {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
    background: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #e74c3c;
}

.new-game-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.new-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.game-status {
    font-size: 1.1rem;
    font-weight: bold;
    color: #27ae60;
    background: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #27ae60;
    min-width: 120px;
    text-align: center;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
    background: #34495e;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    max-width: 450px;
}

.game-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    margin: 20px 0;
}

.cell:hover {
    background: #d5dbdb;
    transform: scale(1.05);
}

.cell.covered {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    border: 2px solid #2c3e50;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.cell.uncovered {
    background: #fff;
    border: 1px solid #bdc3c7;
}

.cell.mine {
    background: #e74c3c;
    color: white;
    border: 2px solid #c0392b;
}

.cell.exploded {
    background: #e74c3c;
    color: white;
    border: 2px solid #c0392b;
    animation: explode 0.5s ease;
}

.cell.flagged {
    background: #f39c12;
    color: white;
    border: 2px solid #e67e22;
}

.cell.question {
    background: #9b59b6;
    color: white;
    border: 2px solid #8e44ad;
}

.cell.incorrect-flag {
    background: #e74c3c;
    color: white;
    border: 2px solid #c0392b;
}

@keyframes explode {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-over-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.game-over h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.game-over.win h2 {
    color: #27ae60;
}

.game-over.lose h2 {
    color: #e74c3c;
}

.game-over button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 20px;
}

.instructions {
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 250px;
    flex-shrink: 0;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions ul {
    text-align: left;
    color: #34495e;
}

.instructions li {
    margin-bottom: 8px;
}

/* Mine Sweeper Responsive Design */
@media (max-width: 768px) {
    .game-container {
        margin: 20px auto;
        padding: 15px;
    }

    .game-controls {
        flex-direction: column;
        gap: 15px;
    }

    .game-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .game-board {
        max-width: 350px;
    }

    .instructions {
        min-width: auto;
        width: 100%;
        max-width: 350px;
    }
}

/* Container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Card styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
}

.card-body {
    padding: 1.5rem;
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-light:hover {
    background-color: #e2e6ea;
}

.btn-dark:hover {
    background-color: #23272b;
}

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Table styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
}

.table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.05);
}

/* Alert styles */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.close-button:hover {
    color: #000;
}

.modal-body {
    padding: 1rem;
}

/* Plot styles */

.enlargeable-plot {
    width: 100%;
    height: 400px;
    background: #000000;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    transition: transform 0.2s;
}

.enlargeable-plot:hover {
    transform: scale(1.02);
}

/* Plot loading states */
.plot-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 18px;
    color: #666;
}

.plot-loading-large {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 28px;
    color: #666;
}

/* Modal plot containers */
.modal-plot-container {
    height: 600px;
}

/* Plot reset info */
.plot-reset-info {
    color: #20c997;
}

/* Modal body styling */
.modal-body {
    color: white;
    font-size: 24px;
    line-height: 1.6;
}

/* Station info styling */
.station-info {
    font-family: Arial, sans-serif;
    min-width: 200px;
}

.station-info h4 {
    margin: 0 0 8px 0;
    color: #20c997;
}

.station-info p {
    margin: 4px 0;
}

/* Game specific styles */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.game-board {
    display: grid;
    gap: 2px;
    background-color: #333;
    padding: 10px;
    border-radius: 8px;
    margin: 1rem 0;
}

.game-cell.revealed {
    background-color: #fff;
}

.game-cell.mine {
    background-color: #ff4444;
    color: white;
}

.game-cell.flagged {
    background-color: #ffaa00;
    color: white;
}

/* Anagram game styles */

.anagram-feedback.correct {
    color: #28a745;
}

.anagram-feedback.incorrect {
    color: #dc3545;
}

/* Travel map styles */

/* Adoption data styles */

/* Weather visualization styles */

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .navbar-nav {
        flex-direction: column;
    }
    
    .nav-item {
        margin: 0.25rem 0;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

}

/* Gap utility classes */
.gap-10 {
    gap: 10px;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.d-block { display: block; }

.d-flex { display: flex; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }

.align-items-center { align-items: center; }

