/* Combined CSS file for JewelFall website */

/* Base styles */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --accent-color: #f7d199;
    --background-color: #f8f9fa;
    --card-color: #ffffff;
    --text-color: #34495e;
    --heading-color: #2c3e50;
    --border-color: #e1e4e8;
    --focus-outline-color: rgba(74, 144, 226, 0.25);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --link-color: #4a90e2;
    --link-hover-color: #3498db;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #5a9eec;
        --secondary-color: #2a4055;
        --accent-color: #f7d199;
        --background-color: #1a202c;
        --card-color: #2d3748;
        --text-color: #e2e8f0;
        --heading-color: #edf2f7;
        --border-color: #4a5568;
    }
    
    header {
        background-color: rgba(26, 32, 44, 0.95);
    }
}

/* Reset box-sizing for all elements */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    width: min(95%, 1500px);
    margin: 0 auto;
    padding: clamp(10px, 2vw, 20px);
    background-color: var(--background-color);
    box-sizing: border-box;
}

/* Header styling - NOT sticky */
header {
    background-color: var(--background-color);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0 0 0;
    border-bottom: 2px solid var(--primary-color);
}

/* Header container */
.header-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

/* When header should be hidden */
.header-hidden {
    display: none;
}

/* Logo container */
.logo-container {
    width: 120px; 
    height: 120px; 
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto 0;
    line-height: 0;
}

.logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    vertical-align: middle;
    margin: 0;
    display: block;
}

.title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    margin: 0;
}

.site-title {
    color: var(--heading-color);
    font-size: 3rem;
    margin: 0 0 0.1rem 0;
    font-weight: 700;
    line-height: 1.1;
}

.subtitle {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin: 0;
    padding: 0;
    font-weight: 500;
    line-height: 1.2;
}

/* Filters and Navigation styles - Sticky */
.filters-container {
    background-color: var(--background-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.5rem 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow 0.3s ease, padding 0.3s ease;
}

.filters-scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.search-container {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 2px solid var(--border-color);
    font-family: inherit;
    font-size: 0.9rem;
    background-color: var(--card-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-outline-color);
}

.clear-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    display: none;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 50%;
}

.clear-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.category-button {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid transparent;
    font-family: inherit;
    font-size: 0.95rem;
}

.category-button.active {
    background-color: #e74c3c;
    font-weight: 600;
}

/* Grid layouts */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.grid-3-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) and (max-width: 1199px) {
    .grid-2-col,
    .grid-3-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .grid-2-col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3-col {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card styles (shared between FAQ items and regular cards) */
.faq-item, .card {
    position: relative;
    margin: 0;
    background-color: var(--card-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--primary-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
    transform: translateY(0);
    overflow: hidden;
    max-width: 100%;
}

.card {
    width: 100%;
}

.faq-item {
    width: 100%;
    box-sizing: border-box;
}

/* Shared hover effect for cards and FAQ items */
.card:hover, .faq-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

/* Shared heading styles */
.question, .card-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--heading-color);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    margin-top: 0;
    line-height: 1.3;
}

/* Shared content styles */
.answer, .card-content {
    color: var(--text-color);
    flex-grow: 1;
}

.answer ul, .answer ol {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.answer li {
    margin-bottom: 0.5rem;
}

.answer p, .card-content p {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Links styling - unified */
.answer a, footer a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.answer a:hover, footer a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Category color coding */
.faq-item[data-category="gameplay"] {
    border-left-color: #2ecc71;
}

.faq-item[data-category="technical"] {
    border-left-color: #e74c3c;
}

.faq-item[data-category="troubleshooting"] {
    border-left-color: #f39c12;
}

.faq-item[data-category="about"] {
    border-left-color: #9b59b6;
}

/* Utility classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Unified focus and hover styles */
.category-button:hover, .category-button:focus {
    background-color: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    outline: none;
}

/* Focus outline for keyboard navigation - unified */
a:focus, button:focus, [tabindex]:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.category-button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation for the heart */
.heart {
    display: inline-block;
    color: #e74c3c;
    animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border: none;
    font-size: 1.2rem;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* Search highlight style */
.highlight {
    background-color: rgba(74, 144, 226, 0.2);
    border-radius: 2px;
    padding: 0 2px;
    font-weight: bold;
}

/* Empty results message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    background: var(--card-color);
    border-radius: 0.5rem;
    margin: 2rem 0;
    box-shadow: var(--card-shadow);
    display: none;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    margin-bottom: 2rem; /* Add bottom margin to prevent scroll issues */
}

/* Contact form styles */
.contact-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--card-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-outline-color);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--heading-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.submit-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.submit-button:hover, .submit-button:focus {
    background-color: var(--link-hover-color);
    transform: translateY(-2px);
}

.form-group .note {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    border-left: 3px solid #4a90e2;
}

@media (prefers-color-scheme: dark) {
    .form-group .note {
        background-color: #2d3748;
        color: #cbd5e0;
        border-left: 3px solid #5a9eec;
    }
}

.form-response {
    margin-top: 1.5rem;
    min-height: 60px;
}

.success-message {
    background-color: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #2ecc71;
}

.error-message {
    background-color: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #e74c3c;
}

.contact-method {
    margin-bottom: 2rem;
}

.contact-method h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.contact-method p {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.contact-method a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.contact-method a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Terms of Service styles */
.card-content h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-content ul, .card-content ol {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.card-content li {
    margin-bottom: 0.5rem;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .header-container {
        flex-direction: row;
        gap: 1rem;
    }
    
    .logo-container {
        width: 90px;
        height: 90px;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .category-button {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
}

/* Ensure responsive layout on smaller screens */
@media (max-width: 767px) {
    .faq-item, .card {
        margin-bottom: 1rem;
        transform: none !important; /* Disable hover transform on mobile to prevent overlap */
    }
}
