/* ===============================
   GLOBAL STYLES
   =============================== */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Lato', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    overflow: hidden; /* prevent page scroll */
}

a {
    text-decoration: none;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

/* ===============================
   HEADER STYLES
   =============================== */
.site-header {
    background-color: #004080;
    color: #f9e6af;
    height: 70px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    height: 50px;
    border-radius: 6px;
}

.site-title {
    font-size: 1.7em;
    font-weight: bold;
    color: #f9e6af;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-right a,
.username {
    color: #f9e6af;
    font-weight: 600;
    font-size: 0.95em;
}

/* Header buttons styling */
.header-btn {
    display: inline-block;
    width: 100px;
    text-align: center;
    padding: 8px 12px;
    margin: 0 5px;
    background-color: #004080;
    color: #fff;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.header-btn:hover {
    background-color: #0066cc;
}

/* Spacer for fixed header */
.header-spacer {
    height: 70px;
}

/* ===============================
   MAIN CONTENT
   =============================== */
main {
    display: flex;
    flex-direction: column; /* search on top, columns below */
    height: calc(100vh - 70px);
    gap: 8px;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

/* ===============================
   SEARCH BAR
   =============================== */
#search-container {
    display: flex;
    gap: 8px;
    padding: 0 8px;
}

#search-container input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border-radius: 4px 0 0 4px;
    border: 1px solid #ccc;
}

#search-container button {
    padding: 0.5rem 1rem;
    border: 1px solid #007BFF;
    background-color: #007BFF;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* ===============================
   TWO-COLUMN HOME LAYOUT
   =============================== */
#home-layout {
    display: flex;
    flex: 1;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

/* LEFT: FILTERS */
#filters-column {
    flex: 0 0 250px;
    min-width: 220px;
    background-color: #d9e6ff;
    padding: 8px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* RIGHT: TILES / RECIPES */
#content-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tiles container */
#tiles-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    row-gap: 1em;  /* vertical gap between rows */
    column-gap: 0.75em; /* horizontal gap */
    flex: 1;
    overflow-y: auto;
    padding: 1px;
}

.tile {
    width: 100%;
    aspect-ratio: 2 / 3; /* 1:1.5 ratio */
    min-width: calc(100% / 5 * 0.5);
    min-height: calc((100% / 5 * 0.5) * 1.5);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    background-color: #eee;
    /* remove padding-bottom; spacing handled by grid gap */
}


.tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Removed the previous .tile span styles completely */


/* Removed the previous .tile span styles completely */


/* Recipe list container */
#recipe-list-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

/* Recipe list rows */
.recipe-row {
    display: flex;
    padding: 8px 12px;
    align-items: center;
}

.recipe-row.even { background-color: #f0f0f0; }
.recipe-row.odd  { background-color: #ffffff; }

.recipe-col {
    flex: 1;
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recipe-col.name { flex: 2; font-weight: 600; cursor: pointer; }
.recipe-col.contributor { flex: 1; }
.recipe-col.date { flex: 0 0 80px; text-align: center; }
.recipe-col.verified { flex: 0 0 40px; text-align: center; }
.recipe-col.record-id { flex: 0 0 60px; text-align: center; font-size: 0.85em; }

/* ===============================
   FILTER PILLS
   =============================== */
#filters-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pill {
    position: relative;
    padding: 6px 16px 6px 28px;
    border-radius: 24px;
    background-color: #003366;
    color: white;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.pill-dot {
    content: '';
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #FFD700;
    display: none;
}

.pill.has-dot .pill-dot {
    display: block;
}

.pill:hover {
    background-color: #004080;
}

.pill-dropdown {
    display: none;
    background-color: #f0f4ff;
    padding: 6px;
    border-radius: 8px;
    max-height: 160px;
    overflow-y: auto;
}

.pill-dropdown.open {
    display: block;
}

.pill-dropdown .item {
    font-size: 1.25em;
    margin: 4px 0;
}

/* ===============================
   UTILITIES
   =============================== */
.hidden {
    display: none !important;
}

/* ===============================
   FONT CONTROLS
   =============================== */
#font-controls {
    display: none;  /* hide by default */
    gap: 6px;
    margin-bottom: 4px;
}

/* Responsive YouTube iframe */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 ratio */
    margin-bottom: 1em;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}




/* ===============================
   RESPONSIVE TILES
   =============================== */
@media (max-width: 1200px) {
    #tiles-container { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    #tiles-container { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    #tiles-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
    #tiles-container { grid-template-columns: 1fr; }
}
