/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    margin: 0 auto;
    padding: 0 20px;
}

/* Full width by default - no max-width constraint */
#mainContainer {
    width: 100%;
}

/* Constrained width when full width is off */
#mainContainer.constrained {
    max-width: 900px;
}

/* Header */
header {
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: padding 0.3s;
}

header.collapsed {
    padding: 0.5rem 0;
}

.header-content {
    max-width: 100%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    margin: 0;
}

header.collapsed h1 {
    font-size: 1.2rem;
}

.header-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.header-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.header-details {
    margin-top: 0.5rem;
    transition: max-height 0.3s, opacity 0.3s;
    max-height: 300px;
    opacity: 1;
    overflow: hidden;
}

.header-details.hidden {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.disclaimer {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.disclaimer p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.disclaimer a {
    color: #ffeb3b;
    text-decoration: underline;
    font-weight: 600;
}

.disclaimer a:hover {
    color: #fff;
}

/* Main Content */
main {
    padding: 1.5rem 0;
    min-height: 60vh;
}

/* Search Section */
.search-section {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.search-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

#sortSelect {
    padding: 0.6rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
}

.clear-btn {
    padding: 0.6rem 1rem;
    background: #e0e0e0;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.clear-btn:hover {
    background: #d0d0d0;
}

.index-btn {
    padding: 0.5rem 0.75rem;
    background: #4a7c59;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.index-btn:hover {
    background: #3a6249;
}

#searchInput {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #4a7c59;
}

.second-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stats-inline {
    color: #4a7c59;
    font-weight: 600;
    font-size: 0.95rem;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.filter-controls label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.filter-controls input[type="checkbox"] {
    cursor: pointer;
}

/* Linear Tours Layout */
.tours-linear {
    display: block;
    margin-bottom: 2rem;
}

/* Grid Layout Option */
.tours-linear.grid-layout {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Compact mode overrides grid - back to block */
.tours-linear.compact {
    display: block !important;
}

/* Kiosk Section */
.kiosk-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kiosk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #4a7c59;
}

.kiosk-header h2 {
    color: #2c5530;
    font-size: 1.5rem;
    margin: 0;
}

.kiosk-link {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background-color: #4a7c59;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.kiosk-link:hover {
    background-color: #3a6249;
}

/* Tour Item */
.tour-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.tour-item:last-child {
    border-bottom: none;
}

.tour-item h3 {
    color: #2c5530;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: color 0.2s;
}

.tour-item h3:hover {
    color: #4a7c59;
    text-decoration: underline;
}

.tour-item p {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

.tour-keywords {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    display: none;
}

.tour-keywords.visible {
    display: block;
}

.tour-keywords .keyword {
    display: inline-block;
    background: #e8f4e8;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: background 0.2s;
}

.tour-keywords .keyword:hover {
    background: #d0e8d0;
}

/* Ultra-Compact Mode - ONE line per kiosk */
.tours-linear.compact .kiosk-section {
    padding: 0.5rem 1rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tours-linear.compact .kiosk-header {
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tours-linear.compact .kiosk-header h2 {
    font-size: 0.9rem;
    margin: 0;
    white-space: nowrap;
}

.tours-linear.compact .kiosk-link {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
}

.tours-linear.compact .tours-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.tours-linear.compact .tour-item {
    display: inline-block;
    padding: 0;
    border: none;
    margin: 0;
}

.tours-linear.compact .tour-item h3 {
    display: inline;
    font-size: 0.85rem;
    margin: 0;
    padding: 0.2rem 0.5rem;
    background: #f0f8f0;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
}

.tours-linear.compact .tour-item h3:hover {
    background: #e0f0e0;
}

.tours-linear.compact .tour-item p {
    display: none;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    color: #666;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 1.5rem 0;
    margin-top: 2rem;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.note {
    font-size: 0.85rem;
    opacity: 0.8;
    font-style: italic;
}

.disclaimer-link {
    color: #ffeb3b;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

.disclaimer-link:hover {
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-row > * {
        width: 100%;
    }

    .second-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-controls {
        gap: 1rem;
    }

    .kiosk-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .kiosk-link {
        width: 100%;
        justify-content: center;
    }

    .tours-linear.grid-layout {
        grid-template-columns: 1fr !important;
    }

    .tours-linear.compact .kiosk-section {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #666;
}
