/* static/css/game.css */

/* Smooth transitions for content updates */
#game-content {
    transition: opacity 0.12s ease-in-out;
}

/* Loading overlay covers the full viewport and blocks interaction */
#loading-overlay {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.65);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease-in-out;
    z-index: 9999;
}

#loading-overlay.visible {
    opacity: 1;
    pointer-events: auto; /* block clicks while visible */
}

#loading-overlay .loading-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(0,0,0,0.08);
    border-top-color: #4A55A2;
    animation: spin 1s linear infinite;
    box-shadow: 0 6px 18px rgba(74,85,162,0.12);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Small helper to dim content while loading (optional) */
.loading-dim { opacity: 0.6; }

/* Make the "Play New Game" button more compact and clean on mobile
   and generally not full-width when used as a small CTA */
.btn-play-again {
    display: inline-block;
    width: auto; /* override .btn's full-width */
    max-width: 280px;
    padding: 10px 18px;
    font-size: 0.98rem;
    border-radius: 10px;
}

/* --- NEW: Win/Thank You Page Styles --- */
.page-title {
    text-align: center;
    color: #4A55A2;
    font-weight: 600;
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.animal-name {
    font-weight: bold;
    font-size: 2.2rem;
    color: #2C3E50;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.secondary-actions {
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.text-link {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 5px;
    display: inline-block;
}

.text-link:hover {
    color: #4A55A2;
    text-decoration: underline;
}

.divider {
    color: #ccc;
    margin: 0 5px;
}

.similar-animals-text {
    font-size: 0.95rem;
    color: #555;
    text-align: center;
    margin-bottom: 25px;
    padding: 0 10px;
}

.play-again-container {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 20px;
}
/* When the play-again button is shown at the top (below the secondary actions)
   show a small centered divider line above the button that is slightly
   wider than the button itself. */
.play-again-container.play-top {
    margin-top: 8px;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.play-again-container.play-top .divider-line {
    width: 160px; /* slightly wider than the button */
    max-width: 70%;
    height: 1px;
    background: #e6e6e6;
    border-radius: 1px;
}
/* End Report Page Styles */

body {
    background-color: #ffffff;
}

.explore-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    background-color: #ffffff;
}

.page-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.page-header .subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Filter Section */
.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

#search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #000;
    border-radius: 0;
    font-size: 1rem;
    -webkit-appearance: none;
}

#search-input:focus {
    outline: none;
    border-color: #000;
}

/* Category Pills */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.category-pill {
    padding: 0.6rem 1.2rem;
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.category-pill:hover {
    background-color: #e0e0e0;
}

.category-pill.active {
    background-color: #4A55A2;
    color: white;
    border-color: #4A55A2;
}

.category-pill .count {
    margin-left: 0.4rem;
    opacity: 0.8;
}

/* Table Section */
.items-table-container {
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 0;
    overflow: hidden;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.items-table thead {
    background-color: #fff;
}

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

.items-table th {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.items-table td {
    color: #555;
}

.item-name {
    color: #1a1a1a;
    font-weight: 500;
}

.item-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 0.85rem;
}

/* Loading and Messages */
.loading-state,
.no-results,
.error-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.3rem solid #f3f3f3;
    border-top: 0.3rem solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #d32f2f;
    background-color: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    padding: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .explore-container {
        padding: 0.5rem;
    }

    .items-table {
        font-size: 0.9rem;
    }
    
    .items-table th,
    .items-table td {
        padding: 0.5rem;
    }
}
