/**
 * Travel Booking Master - Package Builder Styles
 * Styles pour le constructeur de packages
 *
 * @package TravelBookingMaster
 * @author Hatem Chanoufi
 */

/* ===========================
   LAYOUT PRINCIPAL
   =========================== */
.tbm-package-builder {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--tbm-spacing-xl) var(--tbm-spacing-lg);
}

/* En-tête */
.tbm-builder-header {
    text-align: center;
    margin-bottom: var(--tbm-spacing-2xl);
}

.tbm-builder-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--tbm-black);
    margin-bottom: var(--tbm-spacing-sm);
}

.tbm-subtitle {
    font-size: var(--tbm-font-size-lg);
    color: var(--tbm-gray-600);
}

/* ===========================
   NAVIGATION ÉTAPES
   =========================== */
. tbm-steps-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--tbm-spacing-2xl);
    background: var(--tbm-white);
    border-radius: var(--tbm-border-radius-lg);
    padding: var(--tbm-spacing-md);
    box-shadow: var(--tbm-shadow-sm);
    overflow-x: auto;
}

. tbm-step-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tbm-spacing-xs);
    padding: var(--tbm-spacing-sm) var(--tbm-spacing-md);
    border-radius: var(--tbm-border-radius);
    cursor: pointer;
    transition: var(--tbm-transition);
    position: relative;
    flex:  1;
    min-width: 100px;
}

.tbm-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tbm-gray-200);
    color: var(--tbm-gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--tbm-font-size-lg);
    transition: var(--tbm-transition);
}

.tbm-step-nav-item.active .tbm-step-number {
    background:  var(--tbm-primary);
    color: var(--tbm-white);
    box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.2);
}

.tbm-step-label {
    font-size: var(--tbm-font-size-sm);
    font-weight: 600;
    color: var(--tbm-gray-600);
}

.tbm-step-nav-item.active .tbm-step-label {
    color:  var(--tbm-primary);
}

/* ===========================
   CONTENU
   =========================== */
.tbm-builder-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: var(--tbm-spacing-xl);
}

/* ===========================
   SIDEBAR
   =========================== */
. tbm-builder-sidebar {
    position: relative;
}

.tbm-sidebar-sticky {
    position: sticky;
    top: 20px;
    background: var(--tbm-white);
    border-radius: var(--tbm-border-radius-lg);
    box-shadow: var(--tbm-shadow-md);
    padding: var(--tbm-spacing-lg);
}

.tbm-sidebar-section {
    padding: var(--tbm-spacing-md) 0;
}

.tbm-sidebar-section: not(:last-child) {
    border-bottom: 1px solid var(--tbm-border-color);
}

.tbm-sidebar-section h3 {
    font-size: var(--tbm-font-size-base);
    font-weight: 700;
    margin-bottom: var(--tbm-spacing-md);
}

/* Voyageurs */
.tbm-number-input {
    display: flex;
    align-items: center;
    gap: var(--tbm-spacing-sm);
}

.tbm-number-input button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tbm-gray-200);
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: var(--tbm-transition);
}

.tbm-number-input button:hover {
    background: var(--tbm-primary);
    color: var(--tbm-white);
}

/* Prix */
.tbm-price-section {
    background: linear-gradient(135deg, var(--tbm-primary-light), var(--tbm-primary));
    margin:  0 calc(var(--tbm-spacing-lg) * -1);
    padding: var(--tbm-spacing-lg) ! important;
    border-radius: 0 0 var(--tbm-border-radius-lg) var(--tbm-border-radius-lg);
    color: var(--tbm-white);
}

/* ===========================
   MAIN
   =========================== */
.tbm-builder-main {
    background: var(--tbm-white);
    border-radius: var(--tbm-border-radius-lg);
    box-shadow: var(--tbm-shadow-sm);
}

.tbm-step {
    display: none;
    padding: var(--tbm-spacing-xl);
}

.tbm-step.tbm-step-active {
    display: block;
    animation: tbm-fade-in 0.3s ease-in;
}

@keyframes tbm-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   RECHERCHE
   =========================== */
.tbm-search-box {
    position: relative;
    margin-bottom: var(--tbm-spacing-xl);
}

.tbm-search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: var(--tbm-font-size-lg);
    border: 2px solid var(--tbm-border-color);
    border-radius: var(--tbm-border-radius-lg);
    transition: var(--tbm-transition);
}

.tbm-search-input:focus {
    border-color: var(--tbm-primary);
    box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.1);
    outline: none;
}

. tbm-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    .tbm-builder-content {
        grid-template-columns: 1fr;
    }

    .tbm-sidebar-sticky {
        position: static;
    }
}

@media (max-width: 768px) {
    .tbm-steps-navigation {
        overflow-x: scroll;
    }

    .tbm-step-nav-item {
        min-width: 80px;
    }
}

/* ===========================
   ENHANCED DESTINATION CARDS
   =========================== */
.tbm-destination-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tbm-destination-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.tbm-destination-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.tbm-destination-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tbm-destination-card:hover .tbm-destination-card-image img {
    transform: scale(1.05);
}

.tbm-destination-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

.tbm-destination-featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.tbm-destination-card-content {
    padding: 20px;
}

.tbm-destination-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 8px;
}

.tbm-destination-card-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #718096;
    font-size: 14px;
    margin-bottom: 12px;
}

.tbm-destination-card-location i {
    font-size: 16px;
}

.tbm-destination-card-description {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tbm-destination-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.tbm-destination-card-price {
    font-size: 14px;
    color: #718096;
}

.tbm-destination-card-price strong {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.tbm-add-destination-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tbm-add-destination-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.tbm-add-destination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Destinations Grid */
.tbm-destinations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* Loading State */
.tbm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.tbm-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.tbm-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.tbm-empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.tbm-empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.tbm-empty-state p {
    font-size: 14px;
    margin-bottom: 0;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .tbm-destinations-grid {
        grid-template-columns: 1fr;
    }
    
    .tbm-destination-card-image {
        height: 180px;
    }
}
