/* === 1. GLOBAL STYLES & TYPOGRAPHY === */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding-top: 80px; /* Leave space for the fixed nav */
    background-color: #f4f7f6;
    background-image: linear-gradient(to bottom, #ffffff, #e9ecef);
    background-attachment: fixed;
}

a {
    text-decoration: none;
    color: #007bff;
}

/* === 2. NAVIGATION & SIDE MENU === */
nav {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

nav a {
    color: #fff;
    font-weight: bold;
    padding: 5px 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

nav a:hover {
    color: #d4a41f;
    border-bottom-color: #d4a41f;
}

nav #logo img {
    width: 100px;
    vertical-align: middle;
}

.side-nav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1001;
    top: 0;
    left: 0;
    background-color: white;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    border-right: 2px solid #333;
}

.close-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 12px 24px;
    font-size: 36px;
    border: none;
    background: none;
    cursor: pointer;
}

.menu-btn {
    padding: 10px 15px;
    font-size: 25px;
    color: black;
    display: block;
    text-align: left;
    transition: color 0.3s ease, background-color 0.3s ease, padding-left 0.3s ease;
}

.menu-btn:hover {
    color: #d4a41f;
    background-color: #f1f1f1;
    padding-left: 20px;
}

#search-bar {
    display: flex;
    align-items: center;
}

#search-bar input {
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    padding: 5px;
}

#clearSearch {
    border: none;
    background: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: none;
    padding: 0 10px;
}

/* === 3. HOMEPAGE SPECIFIC STYLES === */
.homepage-body {
    background: url('/banner.png') center center fixed;
    background-size: cover;
}

.homepage-body::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    background: linear-gradient(transparent, white);
    z-index: -1;
}

.homepage-content {
    text-align: center;
    margin-top: 10vh;
}

.homepage-content h1, .homepage-content p {
    color: #ffffff;
    text-shadow: 0px 1px 4px rgba(0,0,0,0.7);
}

.homepage-content .action-button {
    display: inline-block;
    padding: 18px 35px;
    font-size: 22px;
    border: none;
    border-radius: 10px;
    background-color: #333;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.5s ease-in-out;
    margin: 10px;
}

.homepage-content .action-button:hover {
    background-color: #d4a41f;
    color: #333;
    transform: scale(1.05);
}

/* === 4. BROWSE PAGE & OS GRID === */
.main-container {
    max-width: 850px;
    margin: 40px auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #333;
}

.page-header p {
    font-size: 1.1rem;
    color: #555;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.product-item a {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    color: #333;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.product-item-image-wrapper {
    width: 100%;
    height: 150px;
    overflow: hidden;
}
.product-item-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-item:hover .product-item-image-wrapper img {
    transform: scale(1.05);
}
.product-item-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.product-item-content h2 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.product-item-content p {
    margin: 0;
    font-weight: bold;
    color: #e44d26;
}

.card-hit-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 10px;
}

.card-hit-counter svg {
    width: 16px;
    height: 16px;
    stroke: #6c757d;
}

.submit-os-card {
    background: #f0f2f5;
    border: 2px dashed #ced4da;
    transition: all 0.3s ease;
}
.submit-os-card a {
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}
.submit-os-card:hover {
    border-color: #d4a41f;
    background-color: #fff;
}
.submit-os-card .plus-icon {
    font-size: 4rem;
    font-weight: 200;
    color: #adb5bd;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    position: absolute;
}
.submit-os-card .submit-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #343a40;
    position: absolute;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}
.submit-os-card:hover .plus-icon {
    transform: translateY(-10px);
    opacity: 0;
}
.submit-os-card:hover .submit-text {
    opacity: 1;
    transform: translateY(0);
}

.filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.filter-container span {
    font-weight: bold;
    color: #555;
    margin-right: 10px;
}
.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.filter-btn:hover {
    background-color: #f1f1f1;
    border-color: #aaa;
}
.filter-btn.active {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* === 5. OS TEMPLATE PAGE === */
.os-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: center;
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
@media (min-width: 768px) {
    .os-layout-grid {
        grid-template-columns: 1fr 1fr;
        padding: 40px;
        gap: 40px;
    }
}
.product-image-container {
    width: 100%;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}
.product-info {
    text-align: center;
}
@media (min-width: 768px) {
    .product-info {
        text-align: left;
    }
}
.product-title {
    font-size: 2.5em;
    margin: 0 0 5px 0;
    color: #333;
}
.developer-name {
    font-size: 1.2rem;
    color: #555;
    font-weight: normal;
    margin: 0 0 20px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.product-description {
    line-height: 1.6;
    color: #333;
}
.action-btn-group {
    margin-top: 25px;
}
.action-btn-group button {
    padding: 12px 24px;
    margin: 5px;
    background-color: #333;
    color: #fff;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease-in-out;
    font-weight: bold;
    font-size: 0.9rem;
}
.action-btn-group button:hover {
    background-color: #d4a41f;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.back-btn {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    padding: 10px 15px;
    display: inline-flex;
    align-items: center;
    font-size: 1.1em;
    margin: 0 auto 20px auto;
    color: #333;
    transition: all 0.3s ease;
}
.back-btn:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}
.back-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.hit-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 20px;
}
.hit-counter svg {
    width: 20px;
    height: 20px;
    stroke: #6c757d;
}

/* === 6. FAQ & CONTACT PAGES === */
.faq-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}
.faq-question {
    padding: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-toggle {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease-in-out;
}
.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    border-top: 1px solid #eee;
    line-height: 1.6;
}
.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}
.faq-item.active .faq-answer {
    padding: 20px;
    max-height: 400px;
}

.contact-card {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}
.contact-card iframe {
    width: 100%;
    height: 650px;
    border: none;
    border-radius: 5px;
}

/* === 7. FOOTER / BOTTOM NAV === */
#bottom-nav {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 999;
    flex-wrap: wrap;
}
#bottom-nav a {
    color: #fff;
    font-weight: bold;
}

/* === Dropdown Menu & Report Modal === */
.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}
.dropdown-menu {
    position: relative;
    display: inline-block;
}
.menu-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
    color: #888;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
}
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}
.dropdown-content a:hover {background-color: #f1f1f1;}
.show {display: block;}

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fefefe;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}
.close-modal-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    border: none;
    background: none;
    cursor: pointer;
}
.close-modal-btn:hover, .close-modal-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
#reportForm { display: flex; flex-direction: column; gap: 10px; }
#reportForm label { font-weight: bold; margin-top: 5px; }
#reportForm input, #reportForm select, #reportForm textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}
#reportForm input[readonly] { background-color: #eee; cursor: not-allowed; }
#reportForm .submit-btn {
    margin-top: 15px;
    padding: 12px 20px;
    background-color: #c0392b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}
#reportForm .submit-btn:hover { background-color: #e74c3c; }
#reportForm .submit-btn:disabled { background-color: #7f8c8d; cursor: not-allowed; }

/* === Loading Spinner === */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Report Modal Enhancements === */
/* New styles for the character counter */
.char-counter {
    font-size: 0.85rem;
    text-align: right;
    color: #6c757d;
    margin-top: -5px;
    padding-right: 5px;
}
.char-counter.invalid {
    color: #e74c3c;
    font-weight: bold;
}

/* Update submit button to match other button styles */
#reportForm .submit-btn {
    background-color: #c0392b;
    border-radius: 25px;
    transition: all 0.3s ease-in-out;
}
#reportForm .submit-btn:hover {
    background-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
#reportForm .submit-btn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Style for disabled report link */
.dropdown-content a.disabled {
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
}
.dropdown-content a.disabled:hover {
    background-color: transparent;
}