/* How It's Played - Main Stylesheet */
/* Consolidated and organized CSS for better maintainability */

/* ==========================================================================
   1. FOUNDATION & RESET
   ========================================================================== */

/* Base typography and theme */
body {
    background-color: white;
    color: black;
    font-family: 'Futura', 'Futura-Light', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
    padding-bottom: 10px;
}

/* Container and layout */
.container, .container-fluid {
    background-color: white;
    color: black;
}

/* Main content width constraint */
.container {
    max-width: 1000px;
}

/* Hero image maximum size constraint */
.hero-section .ratio {
    max-width: 600px;
    max-height: 400px;
}

/* Game cards maximum width on desktop */
@media (min-width: 992px) {
    .game-card {
        max-width: 400px;
        margin: 0 auto;
    }
}



/* ==========================================================================
   2. TYPOGRAPHY
   ========================================================================== */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    color: black;
}

/* Buttons and interactive elements */
.btn {
    font-weight: 300;
}

.small, small {
    font-weight: 300;
}

/* ==========================================================================
   3. NAVIGATION
   ========================================================================== */

.navbar {
    background-color: white;
    border-bottom: none;
    width: 100%;
}

.navbar .container-fluid {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.navbar-brand, .navbar-nav .nav-link {
    color: black;
}

.navbar-nav .nav-link {
    font-size: 1.375rem;
    font-weight: 400;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    width: -moz-fit-content;
    min-width: 80%;
    height: 2px;
    background-color: #00AEEF;
}

/* Desktop navigation styling */
@media (min-width: 768px) {
    .navbar .container-fluid {
        max-width: none;
        width: 100%;
    }
    
    .navbar-expand-lg .navbar-nav {
        margin-left: auto;
    }
}

/* Logo styling */
.logo-container {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.brand-logo-mobile {
    height: 90px;
    width: auto;
}

.brand-logo-desktop {
    height: 90px;
    width: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
}

.navbar-brand {
    display: flex;
    align-items: center;
    overflow: visible;
    padding-top: 0;
    padding-bottom: 0;
}

/* ==========================================================================
   4. CARDS & GAME LISTINGS
   ========================================================================== */

/* Base card styling */
.card {
    background-color: white;
    color: black;
    border: 1px solid #dee2e6;
}

.card-body {
    background-color: white;
    color: black;
}

.card-header {
    background-color: #f8f9fa;
    color: black;
    border-bottom: 1px solid #dee2e6;
}

/* Game cards */
.game-card {
    background-color: rgba(238, 200, 129, 0.05);
    color: black;
    border: 1px solid black;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Rule cards - match game cards exactly */
.rule-card {
    background-color: rgba(238, 200, 129, 0.05);
    color: black;
    border: 1px solid black;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rule-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rule-card .card-body {
    background-color: rgba(238, 200, 129, 0.05);
    color: black;
}

.game-card .card-body {
    background-color: rgba(238, 200, 129, 0.05);
    color: black;
    padding: 0.75rem 1.25rem 0.5rem 1.25rem;
}

.game-card .card-img-top {
    height: 280px;
    object-fit: cover;
    margin: 0;
    padding: 0;
}

.game-card-placeholder {
    height: 280px;
    background-color: var(--bs-gray-200);
    color: var(--bs-gray-600);
}

/* Game card typography and spacing */
.game-card h5.card-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    padding-top: 0;
}

.game-card p.card-text {
    margin-bottom: 0;
    padding-bottom: 0;
}

.game-card .mt-3 {
    margin-top: 0.25rem;
}

.game-card .mb-3 {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Game card sections */
.game-card .intoxication-section {
    margin-top: 2rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* ==========================================================================
   5. GAME DETAIL PAGES
   ========================================================================== */

/* Game detail layout */
.game-text {
    line-height: 1.4;
    white-space: normal;
    margin-top: 0;
    font-size: 1rem;
}

.game-instructions {
    line-height: 1.7;
    white-space: pre-line;
    margin-top: -12px;
}

.game-meta {
    margin-bottom: 2rem;
}

.game-meta-item {
    margin-bottom: 0.5rem;
}

/* Section headers with blue underlines */
.game-detail-section h3,
h3[style*="border-bottom"] {
    border-bottom: 3px solid #00AEEF;
    padding-bottom: 0.5rem;
}

/* Mobile game detail alignment */
@media (max-width: 767.98px) {
    /* Mobile game title */
    .game-title-mobile {
        text-align: center !important;
        width: 100% !important;
        display: block !important;
    }
    
    /* Mobile section alignment - align all headings with content paragraphs */
    .d-md-none h3 {
        margin-left: 0 !important;
        padding-left: 0 !important;
        position: relative !important;
        left: 0 !important;
    }
    
    /* Remove Bootstrap column padding that causes indentation */
    .d-md-none .col-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Remove margin/padding from section containers */
    .d-md-none .mb-4 {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
}

/* Desktop traits section border */
.col-md-4 .card.mb-4 {
    border: 3px solid #00AEEF;
}

/* ==========================================================================
   6. ATTRIBUTES & PROGRESS BARS
   ========================================================================== */

.attribute-bar {
    height: 6px;
    border-radius: 3px;
    background-color: white;
    border: 1px solid #00AEEF;
    margin-bottom: 15px;
    overflow: hidden;
}

.attribute-bar .fill {
    height: 100%;
    background-color: #00AEEF;
}

.attribute-label {
    font-size: 0.8rem;
    color: black;
    margin-bottom: 5px;
}

.complexity-fill,
.intoxication-fill {
    background-color: #00AEEF;
}

.start-state-fill {
    background-color: var(--bs-success);
}

.duration-fill {
    background-color: var(--bs-warning);
}

/* ==========================================================================
   7. FILTERS & SEARCH
   ========================================================================== */

/* Pulse animation for attention */
@keyframes pulseAttention {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.filters-section {
    background-color: var(--bs-gray-800);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.quick-filters {
    background-color: #f8f9fa;
    border: 2px solid rgba(128, 128, 128, 0.3);
    border-radius: 0.75rem;
    padding: 1rem 1rem 0.5rem 1rem;
    margin-bottom: 0.5rem;
    position: relative;
    animation: pulseAttention 0.6s ease-in-out 0.2s 1;
}

/* Desktop-specific styling for better spacing */
@media (min-width: 768px) {
    .quick-filters {
        padding-top: 1.5rem;
    }
    
    .quick-filters .row {
        margin-top: 0.5rem;
    }
    
    .quick-filters .filter-group-title {
        margin-top: 0.25rem;
    }
    
    /* Larger buttons for desktop */
    .quick-filters .btn-xs {
        font-size: 0.9rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Mobile-specific styling for compact buttons */
@media (max-width: 767.98px) {
    .quick-filters .btn-xs {
        font-size: 0.8rem;
        padding: 0.1rem 0.2rem;
        margin-right: 0.125rem;
        margin-bottom: 0.05rem;
        min-width: 4rem;
        text-align: center;
    }
    
    /* Minimize vertical spacing between elements */
    .quick-filters .filter-group {
        margin-bottom: 0.1rem;
    }
    
    .quick-filters .filter-group-title {
        margin-bottom: 0.025rem;
        margin-top: 0.025rem;
        font-size: 0.75rem;
    }
    
    .quick-filters .d-flex.flex-wrap {
        margin-bottom: 0.025rem;
    }
    
    .quick-filters .row {
        margin-bottom: 0;
    }
    
    /* Reduce space above Game Finder title on mobile */
    .container {
        padding-top: 0;
    }
    
    .d-flex.justify-content-end.align-items-center {
        margin-top: -1.5rem;
        margin-bottom: 0.125rem;
    }
    
}

/* Reduce game card vertical spacing - apply to all screen sizes */
.game-card .card-body {
    padding: 1rem 1.25rem 0.75rem 1.25rem !important;
}

/* Add small space above Complexity section but reduce from default */
.game-card .mt-3[style*="border-top"] {
    margin-top: 0.5rem !important;
    padding-top: 0 !important;
}

/* Reduce spacing within attributes section */
.game-card .mb-2 {
    margin-bottom: 0.1rem !important;
}

/* Add small space above Complexity title */
.game-card .mt-3[style*="border-top"] .mb-2:first-child {
    margin-top: 0.25rem !important;
}

/* Override inline styles on Intoxication Impact section */
.game-card .mb-2[style*="margin-top: 6px"] {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove bottom margin from the badges section (Players and Duration) */
.game-card .mb-3 {
    margin-bottom: 0 !important;
}

/* Add "game filters" title centered and inline with border */
.quick-filters::before {
    content: "game filters";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 0 12px;
    font-size: 14px;
    font-weight: normal;
    color: rgba(128, 128, 128, 0.7);
    z-index: 1;
}

.quick-filters .btn {
    transition: all 0.2s;
    margin-right: 0.25rem;
}

.filter-group {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group:last-child {
    border-bottom: none;
}

/* ==========================================================================
   8. ANIMATIONS
   ========================================================================== */

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 174, 239, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 174, 239, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 174, 239, 0);
    }
}

.btn.pulse {
    animation: pulse 2s infinite;
    background-color: #00AEEF !important;
    border-color: #00AEEF !important;
    color: white !important;
}

/* ==========================================================================
   9. ADMIN INTERFACE
   ========================================================================== */

.admin-section {
    background-color: var(--bs-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-label {
    color: #000;
    font-weight: 500;
}

#categories-section .form-check-label {
    color: #000;
}

#categories-section .card {
    color: #000;
}

/* ==========================================================================
   10. UTILITIES
   ========================================================================== */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer */
.footer {
    background-color: white !important;
    color: black !important;
    padding: 0.5rem 0;
    width: 100%;
    border-top: 1px solid #dee2e6;
}

.footer * {
    color: black !important;
}

.footer a {
    color: #00AEEF !important;
}

/* Game Detail Image Sizing - Square on all devices */
.game-header-image {
    height: 250px;
    width: 250px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Desktop sidebar - larger square to match traits width */
@media (min-width: 768px) {
    .col-md-4 .game-header-image {
        height: 280px;
        width: 100%;
        aspect-ratio: 1;
    }
}

.game-header-image-placeholder {
    height: 250px;
    width: 250px;
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    color: #6c757d;
}

@media (min-width: 768px) {
    .col-md-4 .game-header-image-placeholder {
        height: 280px;
        width: 100%;
        aspect-ratio: 1;
    }
}

/* Similar Games button styling - inverted colors with our blue */
.btn-outline-primary {
    background-color: #00AEEF !important;
    border-color: #00AEEF !important;
    color: white !important;
}

.btn-outline-primary:hover {
    background-color: white !important;
    border-color: #00AEEF !important;
    color: #00AEEF !important;
}

/* Reduce spacing between Traits items on desktop */
@media (min-width: 768px) {
    .col-md-4 .game-meta-item {
        margin-bottom: 1rem !important;
    }
    
    .col-md-4 .attribute-bar {
        margin-bottom: 8px !important;
    }
    
    /* Thicker and darker horizontal separator above URL buttons */
    .col-md-4 hr {
        border-top: 3px solid #6c757d !important;
    }
    
    /* Remove underline from Traits title on desktop */
    .col-md-4 .card-title {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
}