/* Cruise Utilities CSS - Toast, Loading, and Polish Styles */

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.cruise-toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.cruise-toast {
    background: #1a1a2e;
    color: white;
    padding: 0.875rem 1.25rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: toastSlideIn 0.3s ease-out forwards;
    pointer-events: auto;
    max-width: 400px;
}

.cruise-toast.toast-success {
    background: #10b981;
}

.cruise-toast.toast-error {
    background: #ef4444;
}

.cruise-toast.toast-info {
    background: #0066cc;
}

.cruise-toast.toast-warning {
    background: #f59e0b;
}

.cruise-toast i {
    font-size: 1.1rem;
}

.cruise-toast .toast-message {
    flex: 1;
}

.cruise-toast .toast-undo {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.cruise-toast .toast-undo:hover {
    background: rgba(255,255,255,0.3);
}

.cruise-toast.toast-exit {
    animation: toastSlideOut 0.3s ease-in forwards;
}

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

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.cruise-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.cruise-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cruise-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: cruiseSpin 0.8s linear infinite;
}

.cruise-loading-text {
    margin-top: 1rem;
    font-weight: 600;
    color: #333;
}

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

/* Inline loading for cards/sections */
.cruise-section-loading {
    position: relative;
    min-height: 200px;
}

.cruise-section-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cruise-section-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #e9ecef;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: cruiseSpin 0.8s linear infinite;
    z-index: 1;
}

/* ============================================
   SKELETON LOADERS
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-title {
    height: 1.5rem;
    width: 80%;
    margin-bottom: 0.75rem;
}

.skeleton-image {
    height: 150px;
    border-radius: 4px;
}

.skeleton-button {
    height: 44px;
    width: 120px;
    border-radius: 4px;
}

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

/* ============================================
   IMPROVED EMPTY STATES
   ============================================ */
.cruise-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px dashed #dee2e6;
}

.cruise-empty-state .empty-icon {
    width: 64px;
    height: 64px;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: #adb5bd;
}

.cruise-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 0.5rem;
}

.cruise-empty-state p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.cruise-empty-state .empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #0066cc;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.cruise-empty-state .empty-cta:hover {
    background: #0052a3;
    color: white;
}

/* ============================================
   INPUT VALIDATION STYLES
   ============================================ */
.cruise-input-group {
    position: relative;
}

.cruise-input-group input {
    padding-right: 2.5rem;
}

.cruise-input-group .validation-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.cruise-input-group.is-valid .validation-icon.valid-icon {
    opacity: 1;
    color: #10b981;
}

.cruise-input-group.is-invalid .validation-icon.invalid-icon {
    opacity: 1;
    color: #ef4444;
}

.cruise-input-group.is-invalid input {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.cruise-input-group.is-valid input {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.cruise-validation-message {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: #ef4444;
    display: none;
}

.cruise-input-group.is-invalid .cruise-validation-message {
    display: block;
}

/* ============================================
   DISABLED BUTTON TOOLTIPS
   ============================================ */
.btn-disabled-wrapper {
    position: relative;
    display: inline-block;
}

.btn-disabled-wrapper .disabled-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    margin-bottom: 0.5rem;
}

.btn-disabled-wrapper .disabled-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.btn-disabled-wrapper:hover .disabled-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   SELECTION FEEDBACK ANIMATION
   ============================================ */
.selection-pulse {
    animation: selectionPulse 0.4s ease-out;
}

@keyframes selectionPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.selection-checkmark {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.selection-checkmark.active {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   UNSAVED CHANGES INDICATOR
   ============================================ */
.unsaved-indicator {
    position: fixed;
    top: 70px;
    right: 1rem;
    background: #f59e0b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
}

.unsaved-indicator.active {
    opacity: 1;
    transform: translateX(0);
}

.unsaved-indicator i {
    animation: unsavedPulse 2s infinite;
}

@keyframes unsavedPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   PRICE UPDATE ANIMATION
   ============================================ */
.price-update {
    animation: priceUpdate 0.5s ease-out;
}

@keyframes priceUpdate {
    0% {
        color: #10b981;
        transform: scale(1.1);
    }
    100% {
        color: inherit;
        transform: scale(1);
    }
}

/* ============================================
   CARD TRANSITION EFFECTS
   ============================================ */
.cruise-card-fade-enter {
    opacity: 0;
    transform: translateY(10px);
}

.cruise-card-fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease-out;
}

/* ============================================
   RESPONSIVE FIXES
   ============================================ */
@media (max-width: 768px) {
    .cruise-toast-container {
        bottom: 80px;
        left: 1rem;
        right: 1rem;
        transform: none;
    }

    .cruise-toast {
        max-width: 100%;
    }

    .cruise-empty-state {
        padding: 2rem 1rem;
    }
}
