/* --- Start of style.css --- */
        
/* Basic Reset & Font Import */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f7f7f7; /* Light grey background */
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMiIgaGVpZ2h0PSIyIiB2aWV3Qm94PSIwIDAgMiAyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGZpbGw9IiNjY2NjYyIgZmlsbC1vcGFjaXR5PSIwLjMiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0iTTAgMWgxVjBoMXYySDF2MWgwVjBoMiIgLz48L2c+PC9zdmc+'); /* Very subtle noise texture */
    background-size: 2px 2px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 0px;
}

/* Header Styling */
.site-header {
    background-color: #ffffff; /* Clean off-white header */
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px; /* Added margin for content separation */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding:0px 20px;
}

.site-logo {
    font-size: 1.6em;
    font-weight: 700;
    color: #b02a2a; /* Famicom Red */
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none; /* Make logo a link */
}

.main-nav a {
    color: #555;
    text-decoration: none;
    margin-left: 25px;
    font-weight: 600;
    transition: color 0.2s ease-in-out;
}

.main-nav a:hover,
.main-nav a.active {
    color: #b02a2a; /* Famicom Red on hover/active */
}

/* Main Content Box Styling (for both pages) */
.main-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    max-width: 1000px; /* Match container */
    margin: 0 auto 40px auto; /* Centering */
    padding: 40px; /* More padding */
}

/* Section Titles */
h2, h3 {
    font-size: 1.5em;
    color: #b02a2a; /* Famicom Red for section titles */
    margin-bottom: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.section-divider {
    border-top: 1px solid #e0e0e0;
    margin: 40px 0;
}

/* --- Styles for Index Page (Search) --- */

.page-title {
    text-align: center;
    color: #333;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-subtitle {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

#region-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.region-toggle {
    font-size: 2.5em; /* 40px */
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    transition: all 0.2s ease-in-out;
}

.region-toggle:not(.filter-active) {
    opacity: 0.3;
    filter: grayscale(80%);
    transform: scale(0.9);
}

.region-toggle:hover {
     opacity: 1;
}

.search-box-wrapper {
    position: relative;
    margin-bottom: 40px;
}

#game-search {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1em;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#game-search:focus {
    border-color: #b02a2a;
    box-shadow: 0 0 0 3px rgba(176, 42, 42, 0.1);
}

#autocomplete-list {
    position: absolute;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    box-shadow: 0 5px 10px rgba(0,0,0,0.05);
}
#autocomplete-list div {
    padding: 12px 20px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05em;
}
#autocomplete-list div:last-child {
    border-bottom: none;
}
#autocomplete-list div:hover {
    background-color: #f9f9f9;
}
#autocomplete-list .autocomplete-platforms {
    color: #777;
    font-size: 0.9em;
}

.content-box {
    background-color: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
}

#on-this-day-box {
    background-color: #fdfdfd; /* Corrected typo from #fdfaf */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
}
#on-this-day-box h3 {
     margin-top: 10px;
     margin-bottom: 15px;
     font-size: 1.3em;
}
#on-this-day-box ul {
    list-style: none;
}
#on-this-day-box li a {
    display: flex;
    align-items: center;
    padding: 8px 15px; /* Reduced padding */
    margin: -4px -15px; /* Adjusted margin */
    border-radius: 6px;
    text-decoration: none;
    color: #444;
    transition: background-color 0.2s;
    font-size: 0.9em; /* Reduced font size */
}
#on-this-day-box li a:hover {
    background-color: #f4f4f4;
}
#on-this-day-box .game-title {
     font-weight: 600;
     margin: 0 8px;
}
#on-this-day-box .game-platform {
    color: #666;
    font-size: 0.95em;
}
#on-this-day-box .game-flags {
    margin-left: auto;
    font-size: 1.25em;
}
#on-this-day-box h4 {
    font-weight: 700;
    color: #555;
    margin-top: 20px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}
#on-this-day-box .weekly-list {
     padding-left: 20px;
     border-left: 2px solid #f0f0f0;
}


/* --- Styles for Game Page (from style.css) --- */

.back-link {
    display: inline-block;
    margin-bottom: 25px;
    color: #555;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.back-link:hover {
    color: #b02a2a;
}

.error-box {
    text-align: center;
    color: #b02a2a;
    background: #fff6f6;
    border: 1px solid #f2d7d7;
    padding: 20px;
    border-radius: 8px;
}
.error-box h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.game-hero {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 40px;
}

.game-cover-art {
    flex-shrink: 0;
    width: 250px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: #eee;
}

.game-cover-art img {
    width: 100%;
    height: auto;
    display: block;
}

.game-header-info {
    flex-grow: 1;
}

/* * UPDATE: 
 * Made this selector specific to the game details page (game.php)
 * by prefixing it with .game-header-info.
 * This stops it from affecting other pages.
 */
.game-header-info .game-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 2.5em;
    color: #b02a2a;
    letter-spacing: 0.5px;
    line-height: 1.4em;
}
}

/* * ADDED:
 * A new style for .game-title when it's inside the "On This Day" box (index.php).
 * This will be much smaller and more appropriate for a list.
 */
#on-this-day-box .game-title {
    font-weight: 600;
    font-size: 1em; /* This will now be relative to the 0.9em on the <a> tag */
    color: #1a2b4c;
    margin: 0 5px;
}

.game-developer {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

/* Overview Section */
.game-overview p {
    font-size: 1.05em;
    line-height: 1.7;
    color: #444;
    white-space: pre-wrap; /* Preserve line breaks from DB */
}

/* Generic Data Table (for Releases) */
.data-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}
.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}
.data-table td:last-child {
     white-space: normal;
}
.data-table th {
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    background-color: #f9f9f9;
    font-size: 0.8em;
    letter-spacing: 0.5px;
}
.data-table tr:last-child td {
    border-bottom: none;
}
.data-table tr:hover {
    background-color: #fcfcfc;
}
.data-table .region-col {
    font-weight: 600;
}
.data-table .date-col {
    color: #666;
}


/* Magazine Appearances Section */
.magazine-section .issue-group {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 20px;
}

.magazine-section .issue-header {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
}
.magazine-section .issue-header .issue-date {
    font-weight: 600;
    color: #666;
    font-size: 0.95em;
}

.magazine-section .articles-list {
    margin-top: 15px;
    space-y: 15px; /* Handled by CSS */
    list-style: none;
}

.magazine-section .articles-list > li {
    padding-left: 20px;
    border-left: 3px solid #b02a2a;
    margin-top: 15px;
}

.magazine-section .article-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #b02a2a;
}

.magazine-section .article-meta {
    font-size: 0.9em;
    color: #777;
    margin: 2px 0 5px 0;
    text-transform: uppercase;
}
.magazine-section .article-meta span {
    font-weight: 600;
    color: #555;
}

.magazine-section .article-description {
    font-size: 0.95em;
    color: #555;
    white-space: pre-wrap; /* Preserve line breaks */
}

/* --- Styles for Calendar Page --- */
/* (Added new styles below) */

.calendar-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    padding: 30px;
    background-color: #fdfdfd; /* Use the light background from "On this day" box */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 40px;
}

.calendar-form .form-group {
    display: flex;
    flex-direction: column;
}

.calendar-form label {
    font-size: 0.85em;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.calendar-form select {
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1em;
    font-family: 'Open Sans', sans-serif;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 10px 10px;
    padding-right: 40px; /* Make space for arrow */
}

.calendar-form select:focus {
    border-color: #b02a2a;
    box-shadow: 0 0 0 3px rgba(176, 42, 42, 0.1);
    outline: none;
}

.calendar-form .search-button {
    padding: 12px 20px;
    border-radius: 6px;
    border: none;
    font-size: 1em;
    font-family: 'Open Sans', sans-serif;
    background-color: #b02a2a; /* Famicom Red */
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    height: 47px; /* Match select box height */
}

.calendar-form .search-button:hover {
    background-color: #c43232;
}

.calendar-results h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    border-bottom: none; /* Remove duplicate border */
    padding-bottom: 0;
    text-transform: none; /* Keep it as regular text */
    letter-spacing: 0;
}

.calendar-results td {
    text-wrap-mode: wrap;
}

.data-table .original-title {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    display: block;
    margin-top: 2px;
    white-space: normal; /* Allow original title to wrap */
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    .site-header {
        margin-bottom: 20px;
    }
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    .main-nav {
        margin-top: 15px;
    }
    .main-nav a {
        margin: 0 10px;
    }
    
    .main-content {
        padding: 20px;
    }

    .game-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .game-cover-art {
        width: 250px;
        margin-bottom: 20px;
    }
    .game-title {
        font-size: 2em;
    }
    .game-developer {
        font-size: 1em;
    }
}
/* --- End of style.css --- */

