/* styles.css */

/* ... KEEP YOUR EXISTING ROOT VARIABLES ... */
:root {
    /* Core Colors */
    --md-sys-color-primary: #556b2f;            /* Club Olive */
    --md-sys-color-on-primary: #ffffff;         
    --md-sys-color-primary-container: #dce8c6;  
    --md-sys-color-on-primary-container: #151f05;
    
    --md-sys-color-secondary: #5d5f53;          
    --md-sys-color-secondary-container: #e2e4d6;
    --md-sys-color-on-secondary-container: #1a1c14;

    --md-sys-color-tertiary: #386666;           
    --md-sys-color-tertiary-container: #bbebec;

    --md-sys-color-error: #ba1a1a;              
    --md-sys-color-on-error: #ffffff;
    
    /* Backgrounds */
    --md-sys-color-background: #fdfdf5;         
    --md-sys-color-on-background: #1a1c18;      
    
    --md-sys-color-surface: #fdfdf5;            
    --md-sys-color-surface-container-low: #f2f4ea; 
    --md-sys-color-on-surface: #1a1c18;
    --md-sys-color-on-surface-variant: #44483d;    
    --md-sys-color-outline: #75796b;            

    /* Shapes */
    --md-elevated-card-container-shape: 20px;
    --md-filled-button-container-shape: 20px;
    --md-filled-text-field-container-shape: 12px 12px 0 0;
}

/* ... KEEP GLOBAL LAYOUT ... */
body {
    font-family: 'Roboto', system-ui, sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    margin: 0;
    padding: 2rem;
    padding-bottom: 100px; 
    max-width: 1200px; 
    margin-left: auto;
    margin-right: auto;
}

h1 {
    text-align: center;
    color: var(--md-sys-color-primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
    letter-spacing: -1px;
}

h2 {
    text-align: center;
    color: var(--md-sys-color-secondary);
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.club-logo {
    display: block; 
    margin: 0 auto 20px auto; 
    max-width: 220px; 
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

/* 3. UPDATED INPUT SECTION (Fixed Alignment) */
.input-container {
    background-color: var(--md-sys-color-surface-container-low);
    padding: 1.5rem;
    border-radius: 24px;
    margin-bottom: 3rem;
    max-width: 900px; /* Slightly wider for the new time field */
    margin-left: auto;
    margin-right: auto;
}

.input-row {
    display: flex; /* Switched to Flex for better alignment control */
    gap: 12px;
    align-items: start; /* Aligns tops of boxes */
    flex-wrap: wrap;
}

/* Flex sizing for inputs */
.input-host { flex: 1 1 150px; }
.input-game { flex: 2 1 200px; }
.input-time { flex: 0 1 110px; } /* Narrow time field */
.input-max  { flex: 0 1 80px; }  /* Narrow max field */
.input-btn  { flex: 0 1 auto; height: 56px; }

/* Toggle Switch Row */
.toggle-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--md-sys-color-secondary);
    font-size: 0.9rem;
    padding-left: 4px;
}

/* 4. GAME CARDS */
#gamesList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

md-elevated-card {
    --md-elevated-card-container-color: var(--md-sys-color-surface-container-low);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

md-elevated-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.1);
}

.card-content {
    padding: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.game-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    line-height: 1.2;
}

.host-line {
    font-size: 0.9rem;
    color: var(--md-sys-color-primary);
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* NEW: Beginner Badge */
.badge-beginner {
    background-color: #c2e7ff;
    color: #004a77;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-block;
}

/* NEW: Time Badge */
.badge-time {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    border-top: 1px solid var(--md-sys-color-outline);
    padding-top: 12px;
    border-color: rgba(117, 121, 107, 0.2);
}

.btn-delete {
    --md-outlined-button-label-text-color: var(--md-sys-color-error);
    --md-outlined-button-outline-color: var(--md-sys-color-error);
}

/* Comments */
.comments-section {
    background-color: #ffffff; 
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

.comment-entry {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.9rem;
}

.comment-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--md-sys-color-error);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 2;
}

/* Mobile */
@media (max-width: 800px) {
    body { padding: 1rem; padding-bottom: 80px; }
    .input-row {
        flex-direction: column; 
    }
    .input-host, .input-game, .input-time, .input-max, .input-btn {
        flex: 1 1 100%;
        width: 100%;
    }
    h1 { font-size: 2rem; }
}

md-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    --md-fab-container-color: var(--md-sys-color-tertiary-container);
    --md-fab-icon-color: var(--md-sys-color-tertiary);
}
