/**
 * Public-facing styles for Duffel Booking plugin
 */

/* Search Form */
.duffel-search-wrapper {
    max-width: 800px;
    margin: 0 auto 40px;
}

.duffel-search-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.duffel-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.duffel-form-group {
    display: flex;
    flex-direction: column;
}

.duffel-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.duffel-form-group input,
.duffel-form-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.duffel-form-group input:focus,
.duffel-form-group select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.duffel-form-group small {
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.duffel-form-actions {
    text-align: center;
    margin-top: 30px;
}

/* Buttons */
.duffel-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.duffel-btn-primary {
    background: #2271b1;
    color: #fff;
}

.duffel-btn-primary:hover {
    background: #135e96;
}

.duffel-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.duffel-btn-secondary:hover {
    background: #e0e0e0;
}

.duffel-btn-book {
    width: 100%;
    margin-bottom: 10px;
}

.duffel-btn-details {
    width: 100%;
    font-size: 13px;
}

.duffel-btn-loader {
    display: none;
    align-items: center;
    gap: 8px;
}

.duffel-btn.loading .duffel-btn-text {
    display: none;
}

.duffel-btn.loading .duffel-btn-loader {
    display: inline-flex;
}

/* Results */
.duffel-results-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

.duffel-results-header {
    margin-bottom: 20px;
}

.duffel-results-header h2 {
    margin: 0 0 5px 0;
}

.duffel-results-count {
    color: #666;
    margin: 0;
}

.duffel-results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Offer Cards */
.duffel-offer-card {
    display: flex;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.duffel-offer-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.duffel-offer-content {
    flex: 1;
    padding: 20px;
}

.duffel-offer-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f9f9f9;
    border-left: 1px solid #ddd;
    min-width: 180px;
}

/* Slices */
.duffel-slice {
    margin-bottom: 20px;
}

.duffel-slice:last-child {
    margin-bottom: 0;
}

.duffel-slice-header {
    margin-bottom: 10px;
}

.duffel-slice-label {
    display: inline-block;
    padding: 4px 10px;
    background: #e5f5fa;
    color: #007ea8;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.duffel-route {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.duffel-airport {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.duffel-time {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.duffel-code {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

.duffel-flight-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.duffel-duration {
    font-size: 12px;
    color: #666;
}

.duffel-flight-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #ddd 50%, transparent 50%);
    background-size: 8px 2px;
    position: relative;
}

.duffel-flight-line::after {
    content: '✈';
    position: absolute;
    right: -5px;
    top: -8px;
    color: #2271b1;
    font-size: 16px;
}

.duffel-stops {
    font-size: 12px;
    color: #666;
}

.duffel-airlines {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.duffel-airline-logo small {
    font-size: 12px;
    color: #666;
}

/* Price */
.duffel-price {
    margin-bottom: 20px;
    text-align: center;
}

.duffel-price-amount {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #2271b1;
}

.duffel-price-currency {
    font-size: 14px;
    color: #666;
}

/* Modal */
.duffel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.duffel-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.duffel-modal-content {
    position: relative;
    max-width: 600px;
    max-height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 8px;
    overflow: auto;
}

.duffel-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #ddd;
}

.duffel-modal-header h2 {
    margin: 0;
}

.duffel-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.duffel-modal-close:hover {
    color: #000;
}

.duffel-modal-body {
    padding: 30px;
}

.duffel-booking-section {
    margin-bottom: 30px;
}

/* Passenger Form */
.duffel-passenger {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.duffel-passenger h4 {
    margin: 0 0 15px 0;
    color: #333;
}

/* Messages */
.duffel-error,
.duffel-success,
.duffel-no-results {
    padding: 15px 20px;
    border-radius: 4px;
    margin: 20px 0;
}

.duffel-error {
    background: #fce4e4;
    border-left: 4px solid #d63638;
    color: #721c24;
}

.duffel-success {
    background: #d4edda;
    border-left: 4px solid #00a32a;
    color: #155724;
}

.duffel-no-results {
    background: #fff3cd;
    border-left: 4px solid #b47d00;
    color: #856404;
    text-align: center;
}

/* Spinner */
.duffel-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: duffel-spin 0.6s linear infinite;
}

@keyframes duffel-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .duffel-offer-card {
        flex-direction: column;
    }
    
    .duffel-offer-sidebar {
        border-left: none;
        border-top: 1px solid #ddd;
        width: 100%;
    }
    
    .duffel-route {
        flex-wrap: wrap;
    }
    
    .duffel-form-row {
        grid-template-columns: 1fr;
    }
}