/* The Roam Chart - Trip Planner Styles */
/* Structural styles only - colors are in themes/*.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 5px;
    font-size: 2rem;
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
}

/* Section Styles */
.section {
    max-width: 1400px;
    margin: 0 auto 40px;
    border-radius: 12px;
    padding: 20px;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: #3498db;
    color: white;
    text-transform: uppercase;
}

/* Gantt Chart Styles */
.gantt-wrapper {
    overflow-x: auto;
}

.gantt {
    display: grid;
    gap: 6px;
    min-width: 1150px;
}

.gantt-header {
    display: grid;
    grid-template-columns: 90px repeat(var(--total-days, 24), 1fr);
    gap: 1px;
    margin-bottom: 5px;
}

.gantt-header-cell {
    text-align: center;
    font-size: 0.65rem;
    padding: 4px 2px;
}

.gantt-header-cell.weekend {
    font-weight: bold;
}

.gantt-header-cell.label {
    text-align: right;
    padding-right: 8px;
}

.day-label {
    font-size: 0.5rem;
    display: block;
}

.gantt-row {
    display: grid;
    grid-template-columns: 90px repeat(var(--total-days, 24), 1fr);
    gap: 1px;
    align-items: center;
}

.gantt-label {
    font-size: 0.8rem;
    font-weight: 600;
    padding-right: 8px;
    text-align: right;
    white-space: nowrap;
}

.gantt-cell {
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.gantt-cell:hover:not(.empty) {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.gantt-cell.empty {
    cursor: default;
}

.gantt-cell.faded {
    opacity: 0.5;
}

/* Daily View Styles */
.daily-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.day-card {
    border-radius: 8px;
    padding: 12px;
    min-height: 140px;
    position: relative;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    color: white;
}

.day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.day-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    padding-bottom: 6px;
}

.day-location {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.day-date-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.day-date {
    font-weight: 700;
    font-size: 0.9rem;
}

.day-dow {
    font-size: 0.7rem;
    opacity: 0.7;
}

.day-number {
    position: absolute;
    bottom: 35px;
    right: 8px;
    font-size: 1.8rem;
    font-weight: 800;
    opacity: 0.15;
}

.day-who {
    font-size: 0.65rem;
    margin-bottom: 8px;
    opacity: 0.85;
}

.day-activities {
    font-size: 0.75rem;
    line-height: 1.5;
}

.activity {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}

.activity-icon {
    font-size: 0.9rem;
}

.activity.booked {
    font-weight: 600;
}

.activity.pending {
    opacity: 0.7;
    font-style: italic;
}

.booked-badge {
    position: absolute;
    top: -8px;
    left: 10px;
    color: white;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Arrival Badge */
.arrival-badge {
    position: absolute;
    top: -8px;
    right: 10px;
    color: white;
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 3px;
}

.arrival-badge i {
    font-size: 0.6rem;
}

/* Gantt cell position for arrival indicator */
.gantt-cell {
    position: relative;
}

/* Gantt Toolbar */
.gantt-toolbar {
    padding: 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.1);
}

/* Gantt Insert Zones */
.gantt-header-cell {
    position: relative;
}

.gantt-insert-zone {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.8);
    color: white;
    font-size: 0.6rem;
}

.gantt-header-cell:hover .gantt-insert-zone,
.gantt-insert-zone:hover {
    opacity: 1;
}

.gantt-insert-zone:hover {
    background: rgba(59, 130, 246, 1);
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.resize-handle-start {
    left: 0;
    border-radius: 4px 0 0 4px;
}

.resize-handle-end {
    right: 0;
    border-radius: 0 4px 4px 0;
}

.gantt-cell:hover .resize-handle {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
}

.resize-handle:hover {
    background: rgba(255, 255, 255, 0.5) !important;
}

/* Resizing state */
body.resizing-traveler {
    cursor: ew-resize !important;
    user-select: none;
}

body.resizing-traveler * {
    cursor: ew-resize !important;
}

/* Drag Preview States */
.gantt-cell.drag-adding {
    background: rgba(34, 197, 94, 0.4) !important;
    outline: 2px dashed #22c55e;
    outline-offset: -2px;
}

.gantt-cell.drag-removing {
    background: rgba(239, 68, 68, 0.4) !important;
    outline: 2px dashed #ef4444;
    outline-offset: -2px;
}

.gantt-cell.drag-invalid {
    background: rgba(239, 68, 68, 0.6) !important;
    outline: 2px solid #ef4444;
    outline-offset: -2px;
    cursor: not-allowed !important;
}

.gantt-cell.drag-invalid::after {
    content: '\2715';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Visual indicators for resizable cells */
.gantt-cell.resize-start,
.gantt-cell.resize-end {
    position: relative;
}

.gantt-cell.resize-start::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.gantt-cell.resize-end::after {
    content: '';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.gantt-row:hover .gantt-cell.resize-start::before,
.gantt-row:hover .gantt-cell.resize-end::after {
    opacity: 1;
}

/* Context menu cursor for label */
.gantt-label {
    cursor: context-menu;
}

/* Day Settings Menu */
.day-settings {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.day-settings-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    opacity: 0.5;
}

.day-card:hover .day-settings-btn {
    opacity: 1;
}

.day-settings-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.day-settings .dropdown-menu {
    font-size: 0.85rem;
}

.day-settings .dropdown-item.active {
    font-weight: 600;
}

/* Leg Dividers */
.leg-divider {
    grid-column: 1 / -1;
    text-align: center;
    padding: 12px 15px;
    font-size: 1rem;
    font-weight: 600;
    margin: 15px 0 10px 0;
    border-left: 4px solid var(--color-accent);
    text-align: left;
}

.leg-divider .leg-name {
    font-weight: 700;
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.icon-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    font-size: 0.8rem;
}

/* Summary Box */
.summary-box {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.85rem;
    line-height: 1.7;
}

/* Flight Details Box */
.flight-details {
    border-radius: 6px;
    padding: 10px;
    margin-top: 8px;
    font-size: 0.7rem;
}

.flight-details .conf {
    font-weight: 700;
}

/* Add Activity Button */
.add-activity-btn {
    width: 100%;
    margin-top: 8px;
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

/* Backlog Panel */
.backlog-panel {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.backlog-panel.open {
    right: 0;
}

.backlog-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.backlog-toggle:hover {
    transform: scale(1.1);
}

.backlog-item {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s;
}

.backlog-item.completed {
    opacity: 0.5;
    text-decoration: line-through;
}

.backlog-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Modal Customizations */
.modal-dark .modal-content {
    border-radius: 8px;
}

.modal-dark .form-control,
.modal-dark .form-select {
    border-radius: 4px;
}

.modal-dark .form-label {
    font-size: 0.85rem;
}

/* Settings Button */
.settings-btn {
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

/* Version badge */
.version-badge {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .daily-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .day-card {
        min-height: 120px;
        padding: 10px;
    }

    .gantt-wrapper {
        font-size: 0.9em;
    }
}
