/**
 * Trip Planner - Core Design System
 * --------------------------------
 * Minimal, clean, and consistent visual shell.
 */

:root {
    /* Color Palette - Clean & Professional */
    --accent-primary: #38bdf8;
    --accent-primary-rgb: 56, 189, 248;
    --accent-primary-hover: #075985;
    --accent-secondary: #f43f5e;
    --accent-secondary-rgb: 244, 63, 94;
    --accent-success: #10b981;
    --accent-success-rgb: 16, 185, 129;
    --accent-warning: #f59e0b;
    --accent-warning-rgb: 245, 158, 11;

    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #020617;

    --text-bright: #f8fafc;
    --text-main: #cbd5e1;
    --text-muted: #94a3b8;
    --text-hint: #64748b;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(255, 255, 255, 0.15);

    --sidebar-width: 280px;
    --header-height: 70px;
}

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

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--text-bright);
}

/* Layout Shell */
.app-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
}

.app-header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-bright);
}



.app-shell {
    display: flex;
    padding-top: 0;
    min-height: calc(100vh - var(--header-height));
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    height: calc(100vh - var(--header-height));
    position: fixed;
    overflow-y: auto;
}

.app-content {
    flex: 1;
    margin-left: 0;
    padding: 2rem;
    min-width: 0; /* Critical for grid children overflow */
}

body.has-sidebar .app-content {
    margin-left: var(--sidebar-width);
}

/* Compact sidebar for tablet */
@media screen and (max-width: 1024px) and (min-width: 768px) {
    :root {
        --sidebar-width: 80px;
    }
    .app-sidebar-title,
    .nav-label,
    .nav-divider {
        display: none;
    }
    .app-sidebar-nav a {
        justify-content: center;
        padding: 1rem;
    }
    .app-sidebar-nav span {
        font-size: 1.5rem;
        margin: 0;
    }
}

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Sidebar Elements */
.app-sidebar-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.app-sidebar-title {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
}

.app-sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.app-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 2rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    border-right: 3px solid transparent;
}

.app-sidebar-nav a.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    border-right: 3px solid var(--accent-primary);
}

.app-sidebar-nav a:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

.nav-divider {
    padding: 1.5rem 2rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--text-bright);
    font-weight: 700;
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-small {
    font-size: 0.85rem;
}

/* Components */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
}

.card-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.card-horizontal {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 2rem;
    align-items: center;
    padding: 1.5rem;
}

@media screen and (max-width: 767px) {
    .card-horizontal {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 1.5rem;
    }
    .card-horizontal > div:first-child {
        margin: 0 auto;
    }
    .card-horizontal > div:last-child {
        width: 100%;
    }
    .card-horizontal .button {
        width: 100%;
    }
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-bright);
    font-family: inherit;
}

.button--primary {
    background: var(--accent-primary);
    color: var(--bg-sidebar);
}

.button--primary:hover {
    background: var(--text-bright);
}

.button--secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-bright);
    border-color: var(--border-subtle);
}

.button--secondary:hover {
    background: var(--border-subtle);
}

.button--danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-secondary);
    border-color: rgba(244, 63, 94, 0.2);
}

.button--danger:hover {
    background: rgba(244, 63, 94, 0.2);
}

.button--small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-bright);
}

input,
textarea,
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    padding: 0.75rem;
    border-radius: 8px;
    color: var(--text-bright);
    font-family: inherit;
    font-size: 1rem;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.3);
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

input.is-invalid:focus,
textarea.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-error {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-error::before {
    content: '⚠️';
    font-size: 0.7rem;
}

.form-row,
.grid-2,
.grid-3 {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

@media screen and (max-width: 767px) {
    .form-actions {
        flex-direction: column;
    }
    .form-actions .button {
        width: 100%;
    }
}

/* Responsive Layout Patterns */
.layout-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.layout-sidebar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

@media screen and (max-width: 1024px) {
    .layout-sidebar {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.table-responsive {
    width: 100%;
    margin-bottom: 2rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-subtle);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Badges & Alerts */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.badge--active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.badge--pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
}

.alert--success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert--error {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-secondary);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.empty-state {
    padding: 6rem 2rem;
    border: 2px dashed var(--border-subtle);
    border-radius: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    margin: 2rem 0;
}

/* Utilities */
.m-b-1 {
    margin-bottom: 1rem;
}

.m-b-2 {
    margin-bottom: 2rem;
}

.text-center {
    text-align: center;
}

/* Page Header & Action Bar Standard */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3.5rem;
    gap: 2rem;
    flex-wrap: wrap; /* Ensure it wraps on tablet/mobile */
}

.page-title-group {
    flex: 1;
}

.page-title {
    font-size: 2.75rem;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 500;
}

.action-bar {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

/* --- Responsive Breakpoints --- */

/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        margin-bottom: 2.5rem;
    }

    .page-title {
        font-size: 2.25rem;
    }

    .action-bar {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Mobile (< 768px) */
@media screen and (max-width: 767px) {
    :root {
        --header-height: 60px;
    }

    .app-header {
        padding: 0 1.25rem;
    }



    .mobile-only {
        display: flex !important;
    }

    .hide-mobile {
        display: none !important;
    }

    /* Sidebar Collapse Logic */
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1100;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        top: 0;
        height: 100vh;
    }

    .app-sidebar.is-active {
        transform: translateX(0);
    }

    /* Overlay for mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(2, 6, 23, 0.8);
        backdrop-filter: blur(4px);
        z-index: 1050;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }

    body.has-sidebar .app-content {
        margin-left: 0;
    }

    .app-content {
        padding: 1.25rem 0.75rem; /* Tighter padding for mobile */
    }

    /* Layout Hierarchy */
    .page-header {
        margin-bottom: 2rem;
    }

    .page-title {
        font-size: 1.85rem;
        word-break: break-word; /* Prevent long titles from breaking layout */
    }

    .page-subtitle {
        font-size: 1rem;
    }

    /* Stack Elements */
    .action-bar {
        flex-direction: column;
        width: 100%;
    }

    .action-bar .button {
        width: 100%;
    }

    /* Grid & Form Stacking */
    .card-grid {
        grid-template-columns: 1fr !important;
    }

    .form-row, 
    .grid-2, 
    .grid-3 {
        grid-template-columns: 1fr !important;
    }

    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1.5rem;
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
    }

    .table {
        min-width: 600px;
    }

    /* Empty State adjustments */
    .empty-state {
        padding: 3rem 1.5rem;
        border-radius: 16px;
    }

    /* Itinerary Timeline Specific Mobile Fixes */
    .timeline-container {
        padding-left: 1.5rem !important;
        margin-left: 0.5rem !important;
    }

    .timeline-dot {
        left: -2.15rem !important;
    }
}

/* Data & Status Components */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.data-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
}

.data-item .data-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-bright);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.status-pill--active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border-color: rgba(16, 185, 129, 0.2);
}

.status-pill--draft {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    border-color: rgba(56, 189, 248, 0.2);
}

.status-pill--danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-secondary);
    border-color: rgba(244, 63, 94, 0.2);
}

.card--purge-auth {
    border-color: var(--accent-secondary) !important;
    padding: 3rem;
    margin-bottom: 2rem;
}

@media screen and (max-width: 767px) {
    .card--purge-auth {
        padding: 1.5rem;
    }
}

/* Participation Hub & Avatar Stacks */
.participants-stack {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.avatar-chip {
    background: var(--accent-primary);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    border: 2px solid var(--bg-card);
    position: relative;
    transition: transform 0.2s ease, z-index 0.2s ease;
}

.avatar-chip:hover {
    transform: scale(1.1);
    z-index: 50 !important;
}

.participation-select {
    width: 100%;
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.participation-select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.participation-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.participation-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.participation-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.participation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.status-summary-group {
    display: flex; 
    gap: 0.5rem; 
    margin-bottom: 1.5rem;
}

.status-summary-item {
    flex: 1; 
    text-align: center; 
    border-radius: 6px; 
    padding: 0.5rem;
}

.status-summary-item--success { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); font-weight: 700; }
.status-summary-item--warning { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); font-weight: 700; }
.status-summary-item--error   { background: rgba(239, 68, 68, 0.1); color: #ef4444; font-weight: 700; }

/* Participation Hub Responsive Fixes */
@media screen and (max-width: 767px) {
    .participation-card-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-nav {
        gap: 1.25rem !important;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 0.25rem;
    }
    
    .tab-link {
        font-size: 0.75rem;
        padding: 0.75rem 0 !important;
        white-space: nowrap;
    }
}

.participants-stack {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}
/* --- Place Scheduler Domain --- */
/* --- Place Scheduler Domain --- */
.scheduler-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2.5rem;
    align-items: flex-start;
}

.palette-container {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.itinerary-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.scheduler-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.scheduler-card--draggable {
    cursor: grab;
}

.opening-hours-block {
    font-size: 0.65rem;
    line-height: 1.5;
    color: var(--text-muted);
    background: rgba(0,0,0,0.12);
    padding: 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.04);
}

.opening-hours-title {
    opacity: 0.6;
    font-weight: 800;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.opening-hours-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.opening-hours-item {
    opacity: 0.9;
}

@media screen and (max-width: 1200px) {
    .scheduler-layout {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
    
    .palette-container {
        position: relative !important;
        top: 0 !important;
        max-height: 600px !important;
        overflow-y: auto !important;
        margin-bottom: 2rem;
    }
}

/* --- Category Taxonomy Components --- */
.category-group { 
    margin-bottom: 2rem; 
    border-left: 2px solid var(--border-subtle); 
    padding-left: 1.5rem; 
}

.category-title { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.15em; 
    color: var(--accent-primary); 
    margin: 0; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    font-weight: 800;
}

.category-count { 
    font-weight: 400; 
    opacity: 0.6; 
    font-size: 0.65rem; 
}

@media (max-width: 768px) {
    .category-group { 
        padding-left: 0.75rem; 
    }
}
/* ==========================================================================
   Landing Page / Front Door (Part 28)
   ========================================================================== */
.landing-hero {
    text-align: center;
    padding: 6rem 0;
    margin-bottom: 4rem;
}

.landing-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
}

.landing-section-spacer {
    margin-bottom: 5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.landing-audience-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: stretch;
}

@media (max-width: 991px) {
    .landing-hero {
        padding: 4rem 0;
        margin-bottom: 3rem;
    }
    
    .landing-hero-title {
        font-size: 2.25rem;
    }
    
    .landing-audience-grid {
        grid-template-columns: 1fr;
    }
    
    .landing-card-mobile-tight {
        padding: 1.5rem !important;
    }
    
    .landing-section-spacer {
        margin-bottom: 3rem;
        padding-bottom: 2rem;
    }
}
