/* TripMaker Custom Styles */

/* jQuery UI Autocomplete - ensure it appears above Bootstrap modals */
.ui-autocomplete {
    z-index: 1060 !important;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Project Cards */
.project-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #dee2e6;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.project-card .card-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.info-row {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row i {
    width: 24px;
    color: #6c757d;
    margin-right: 8px;
}

/* Sidebar Navigation */
.sidebar {
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    color: #495057;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

.sidebar .nav-link i {
    margin-right: 8px;
    width: 20px;
}

/* Section Content */
.section-content {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flight Cards */
.flight-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;           /* slightly tighter for compact layout */
    margin-bottom: 0;        /* spacing handled by grid gutters */
    transition: all 0.2s;
    display: flex;           /* allow equal-height columns */
    flex-direction: column;
}

.flight-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd;
}

.flight-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.flight-endpoint {
    text-align: center;
    flex: 1;
}

.flight-endpoint .airport-code {
    font-size: 24px;
    font-weight: bold;
    color: #0d6efd;
}

.flight-endpoint .time {
    font-size: 18px;
    font-weight: 500;
    margin-top: 4px;
}

.flight-endpoint .date {
    font-size: 12px;
    color: #6c757d;
}

.flight-arrow {
    flex: 0 0 100px;
    text-align: center;
    position: relative;
    margin: 0 20px;
}

.flight-arrow i {
    font-size: 24px;
    color: #0d6efd;
}

.flight-duration {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

.flight-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #dee2e6;
    margin-top: auto;        /* anchor details at bottom for equal-height cards */
}

.flight-airline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.airline-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.flight-price {
    text-align: right;
}

.price-label {
    font-size: 12px;
    color: #6c757d;
}

.price-amount {
    font-size: 24px;
    font-weight: bold;
    color: #198754;
}

.price-per-person {
    font-size: 11px;
    color: #6c757d;
}

/* Accommodation Cards */
.accommodation-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.accommodation-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd;
}

.accommodation-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.accommodation-info {
    padding: 16px;
}

.hotel-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #212529;
}

.hotel-rating {
    color: #ffc107;
    margin-bottom: 8px;
}

.hotel-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.amenity-badge {
    font-size: 11px;
    padding: 4px 8px;
}

/* Activity Calendar */
.activity-day {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: white;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0d6efd;
}

.day-date {
    font-size: 18px;
    font-weight: bold;
    color: #0d6efd;
}

.time-slot {
    margin-bottom: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0d6efd;
}

.time-slot-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.activity-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin-top: 8px;
    cursor: move;
    transition: all 0.2s;
}

.activity-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.activity-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.activity-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #6c757d;
}

/* Exclusions List */
.exclusion-item {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    transition: all 0.2s;
}

.exclusion-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd;
}

.exclusion-text {
    flex: 1;
    color: #495057;
}

.exclusion-actions {
    display: flex;
    gap: 8px;
}

/* Cost Breakdown Table */
#costBreakdownTable {
    font-size: 14px;
}

#costBreakdownTable thead {
    background: #f8f9fa;
}

#costBreakdownTable th {
    font-weight: 600;
    color: #495057;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
}

#costBreakdownTable td {
    padding: 12px;
    vertical-align: middle;
}

.cost-editable {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.cost-editable:hover {
    background: #e9ecef;
}

.cost-manually-adjusted {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    height: 20px;
    margin-bottom: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Badges */
.badge-option {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Status Colors */
.status-draft {
    background-color: #6c757d;
}

.status-active {
    background-color: #198754;
}

.status-quoted {
    background-color: #0dcaf0;
}

.status-closed {
    background-color: #343a40;
}

/* Auto-save Status */
.auto-save-status {
    display: flex;
    align-items: center;
    gap: 4px;
}

.auto-save-status.saving {
    color: #ffc107;
}

.auto-save-status.saved {
    color: #198754;
}

.auto-save-status.error {
    color: #dc3545;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s;
    }

    .sidebar.show {
        left: 0;
    }

    .flight-route {
        flex-direction: column;
    }

    .flight-arrow {
        transform: rotate(90deg);
        margin: 16px 0;
    }

    .flight-details {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .accommodation-card {
        margin-bottom: 20px;
    }
}

/* Drag and Drop */
.sortable-ghost {
    opacity: 0.4;
    background: #e9ecef;
}

.sortable-chosen {
    cursor: move;
}

/* Progress Indicators */
.progress-step {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.progress-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
}

.progress-step-icon.complete {
    background: #198754;
    color: white;
}

.progress-step-icon.incomplete {
    background: #e9ecef;
    color: #6c757d;
}

.progress-step-text {
    flex: 1;
}

/* Modal Improvements */
.modal-header.bg-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.modal-lg {
    max-width: 900px;
}

/* Filters */
.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #0d6efd;
    color: white;
    border-radius: 16px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.filter-badge .remove {
    cursor: pointer;
    margin-left: 4px;
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    button,
    .btn {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
