/**
 * Estilos para el Sistema Mejorado de Viajes
 * Incluye tarjetas de itinerarios, exportación y preview
 */

/* Estado vacío */
.wptc-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    margin: 20px 0;
}

.wptc-empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.8;
}

.wptc-empty-state h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.wptc-empty-state p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Header de viajes */
.wptc-trips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.wptc-trips-stats {
    display: flex;
    gap: 20px;
}

.wptc-stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-size: 0.9em;
    backdrop-filter: blur(10px);
}

.wptc-stat strong {
    font-size: 1.2em;
    color: #00d2ff;
}

/* Grid de viajes */
.wptc-trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Tarjetas de viaje */
.wptc-trip-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.wptc-trip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 210, 255, 0.5);
}

.wptc-trip-card-header {
    padding: 20px 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wptc-trip-destination h3 {
    color: white;
    margin: 0 0 8px 0;
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.3;
}

.wptc-trip-location {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 0.9em;
}

/* Menú de opciones */
.wptc-trip-menu {
    position: relative;
}

.wptc-trip-menu-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.wptc-trip-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.wptc-trip-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.wptc-trip-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wptc-trip-menu-dropdown button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.3s ease;
    color: #333;
    font-size: 0.9em;
}

.wptc-trip-menu-dropdown button:hover {
    background: #f8f9fa;
}

.wptc-trip-menu-dropdown button:last-child {
    color: #e74c3c;
}

.wptc-trip-menu-dropdown button:last-child:hover {
    background: #fee;
}

/* Cuerpo de la tarjeta */
.wptc-trip-card-body {
    padding: 20px;
}

.wptc-trip-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.wptc-trip-detail {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wptc-detail-icon {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.wptc-detail-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    flex: 1;
}

/* Exportaciones disponibles */
.wptc-trip-exports {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wptc-exports-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8em;
    display: block;
    margin-bottom: 8px;
}

.wptc-export-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wptc-export-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.wptc-export-pdf {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.wptc-export-pdf:hover {
    background: rgba(231, 76, 60, 0.3);
    color: white;
}

.wptc-export-ics {
    background: rgba(52, 152, 219, 0.2);
    color: #22c55e;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.wptc-export-ics:hover {
    background: rgba(52, 152, 219, 0.3);
    color: white;
}

/* Footer de la tarjeta */
.wptc-trip-card-footer {
    padding: 15px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wptc-trip-saved-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8em;
}

.wptc-trip-actions {
    display: flex;
    gap: 10px;
}

/* Botones */
.wptc-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
}

.wptc-btn-sm {
    padding: 6px 12px;
    font-size: 0.8em;
}

.wptc-btn-primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.wptc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.wptc-btn-outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.wptc-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Modal de itinerario */
.wptc-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.wptc-modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: wptc-modal-slide-in 0.3s ease-out;
}

@keyframes wptc-modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wptc-close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #666;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.wptc-close-modal:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.wptc-modal-body {
    padding: 30px;
}

.wptc-modal-loader {
    text-align: center;
    padding: 50px;
    color: #666;
}

.wptc-modal-loader::before {
    content: "⏳";
    font-size: 2em;
    display: block;
    margin-bottom: 15px;
    animation: wptc-spin 2s linear infinite;
}

.wptc-modal-loader::after {
    content: "Cargando itinerario...";
    font-size: 1.1em;
}

@keyframes wptc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .wptc-trips-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .wptc-trips-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wptc-trip-card-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .wptc-trip-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .wptc-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .wptc-modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .wptc-trip-card {
        margin: 0 -10px;
    }
    
    .wptc-trip-card-header,
    .wptc-trip-card-body,
    .wptc-trip-card-footer {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .wptc-trip-details {
        gap: 10px;
    }
    
    .wptc-export-badges {
        justify-content: center;
    }
}

/* Animaciones adicionales */
@keyframes wptc-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wptc-trip-card {
    animation: wptc-fade-in 0.5s ease-out;
}

.wptc-trip-card:nth-child(1) { animation-delay: 0.1s; }
.wptc-trip-card:nth-child(2) { animation-delay: 0.2s; }
.wptc-trip-card:nth-child(3) { animation-delay: 0.3s; }
.wptc-trip-card:nth-child(4) { animation-delay: 0.4s; }
.wptc-trip-card:nth-child(5) { animation-delay: 0.5s; }
.wptc-trip-card:nth-child(6) { animation-delay: 0.6s; }

/* Estados de carga */
.wptc-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.wptc-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: wptc-spin 1s linear infinite;
}

/* Estilos para imágenes de destino */
.wptc-trip-image {
    position: relative;
    height: 200px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wptc-trip-image.has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.wptc-trip-image.no-image {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.wptc-trip-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 70%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wptc-trip-image:hover .wptc-trip-image-overlay {
    opacity: 1;
}

.wptc-view-details-btn {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #333 !important;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(10px);
}

.wptc-view-details-btn:hover {
    background: white !important;
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.destination-emoji {
    font-size: 4em;
    opacity: 0.3;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Ajustar el card para incluir la imagen */
.wptc-trip-card {
    overflow: hidden;
}

.wptc-trip-card .wptc-trip-card-header {
    border-radius: 0;
}

/* Responsive para imágenes */
@media (max-width: 768px) {
    .wptc-trip-image {
        height: 150px;
    }
    
    .wptc-view-details-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .destination-emoji {
        font-size: 3em;
    }
}

@media (max-width: 480px) {
    .wptc-trip-image {
        height: 120px;
    }
    
    .wptc-trip-image-overlay {
        padding: 15px;
    }
    
    .destination-emoji {
        font-size: 2.5em;
    }
}