/* Flight Search Wizard Styles */

/* Hide destination options by default - JavaScript will show available ones */
.destination-option {
    display: none;
}

/* Step transitions */
.step-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Radio button checkmark animation */
.airport-option input[type="radio"]:checked ~ div svg,
.destination-option input[type="radio"]:checked ~ div svg {
    display: block;
    animation: checkmark-pop 0.3s ease-out;
}

/* Checkbox checkmark animation */
.duration-option input[type="checkbox"]:checked ~ div svg,
.period-option input[type="checkbox"]:checked ~ div svg,
.airline-option input[type="checkbox"]:checked ~ div svg {
    display: block;
    animation: checkmark-pop 0.3s ease-out;
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Selection pulse effect */
.airport-option:has(input:checked),
.destination-option:has(input:checked) {
    animation: selection-pulse 0.6s ease-out;
}

@keyframes selection-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(79, 70, 229, 0);
    }
}

/* Checked state styling */
.airport-option:has(input:checked),
.destination-option:has(input:checked),
.flight-type-option:has(input:checked) {
    border-color: rgb(99 102 241) !important;
    background-color: rgb(238 242 255) !important;
}

/* Departure Day option styling */
.departure-day-option:has(input:checked) {
    border-color: rgb(99 102 241) !important;
    background-color: rgb(238 242 255) !important;
}

.departure-day-option:has(input:checked) span {
    color: rgb(49 46 129) !important;
    font-weight: 600;
}

.duration-option:has(input:checked),
.period-option:has(input:checked) {
    border-color: rgb(99 102 241) !important;
    background-color: rgb(238 242 255) !important;
}

.airline-option:has(input:checked) {
    border-color: rgb(99 102 241) !important;
    background-color: white !important;
}

/* Summary badge animation */
.inline-flex.items-center {
    animation: badge-slide-in 0.3s ease-out;
}

@keyframes badge-slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Search button animation */
#search-button-container {
    animation: fade-in-up 0.4s ease-out;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .main-title {
        padding: 2rem 0 !important;
    }

    .airport-option,
    .destination-option {
        padding: 1rem !important;
    }

    .duration-option {
        padding: 0.75rem !important;
    }

    /* Stack airports vertically on very small screens */
    @media (max-width: 400px) {
        .grid.grid-cols-2.sm\\:grid-cols-4 {
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        }
    }
}

/* Disable hover effects on touch devices to prevent "stuck" hover state */
@media (hover: none) {
    .airport-option:hover:not(:has(input:checked)),
    .destination-option:hover:not(:has(input:checked)),
    .duration-option:hover:not(:has(input:checked)),
    .flight-type-option:hover:not(:has(input:checked)),
    .departure-day-option:hover:not(:has(input:checked)) {
        border-color: rgb(229 231 235) !important;
        background-color: transparent !important;
    }
    
    .airline-option:hover:not(:has(input:checked)) {
        border-color: rgb(229 231 235) !important;
        background-color: white !important;
    }
    
    .calendar-day:hover:not(.range-start):not(.range-end):not(.in-range) {
        background-color: transparent !important;
        color: inherit !important;
    }
}

/* Print styles */
@media print {
    .bg-gradient-to-tr {
        display: none;
    }
    
    body {
        background-color: white !important;
    }
}

/* Focus states for accessibility */
.airport-option:has(input:focus-visible),
.destination-option:has(input:focus-visible),
.duration-option:has(input:focus-visible),
.period-option:has(input:focus-visible),
.airline-option:has(input:focus-visible),
.flight-type-option:has(input:focus-visible),
.departure-day-option:has(input:focus-visible) {
    outline: 2px solid rgb(99 102 241);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Step number badge */
.w-8.h-8 {
    transition: background-color 0.3s ease;
}

/* Edit button hover effect */
#step-1-edit:hover,
#step-2-edit:hover,
#step-3-edit:hover,
#step-4-edit:hover,
#step-5-edit:hover {
    transform: translateX(2px);
}

/* Loading state (for future use) */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgb(99 102 241);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}
/* Calendar Styles */
.calendar-month {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.calendar-header .nav-btn {
    padding: 0.25rem;
    border-radius: 0.375rem;
    color: #6b7280;
    transition: all 0.15s;
    cursor: pointer;
    background: none;
    border: none;
}

.calendar-header .nav-btn:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.calendar-month-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    padding: 0.5rem 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.calendar-day:not(.disabled):not(.other-month):not(.range-start):not(.range-end):hover {
    background-color: #eef2ff;
    color: #4f46e5;
}

.calendar-day.other-month {
    color: #d1d5db;
    cursor: default;
}

.calendar-day.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    text-decoration: line-through;
}

.calendar-day.today {
    font-weight: 700;
    color: #4f46e5;
}

.calendar-day.range-start,
.calendar-day.range-end {
    background-color: #4f46e5;
    color: white;
    font-weight: 600;
}

.calendar-day.in-range {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.calendar-day.range-hover {
    background-color: #dbeafe;
    color: #3b82f6;
}

.calendar-day.selected-period {
    background-color: #dcfce7;
    color: #166534;
}
/* New step design styles */

/* Step content collapse/expand transitions */
#step-1-content,
#step-2-content,
#step-3-content,
#step-4-content,
#step-5-content {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

/* Collapsed summary hover effect */
#step-1-summary:not(.hidden),
#step-2-summary:not(.hidden),
#step-3-summary:not(.hidden),
#step-4-summary:not(.hidden),
#step-5-summary:not(.hidden) {
    cursor: pointer;
}

#step-1-summary:hover,
#step-2-summary:hover,
#step-3-summary:hover,
#step-4-summary:hover,
#step-5-summary:hover {
    background-color: rgba(249, 250, 251, 1);
}

/* Edit button in collapsed summary */
#step-1-summary button,
#step-2-summary button,
#step-3-summary button,
#step-4-summary button,
#step-5-summary button {
    transition: all 0.15s ease;
}

#step-1-summary button:hover,
#step-2-summary button:hover,
#step-3-summary button:hover,
#step-4-summary button:hover,
#step-5-summary button:hover {
    transform: translateX(2px);
}

/* Green checkmark circle animation */
.w-10.h-10.rounded-full.bg-green-500 {
    animation: checkmark-circle-pop 0.4s ease-out;
}

@keyframes checkmark-circle-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Step container border and shadow improvements */
#step-1-container,
#step-2-container,
#step-3-container,
#step-4-container,
#step-5-container {
    border-width: 2px;
}

/* Gradient button styles */
button.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

/* Summary section text styles */
#step-1-summary h4,
#step-2-summary h4,
#step-3-summary h4,
#step-4-summary h4,
#step-5-summary h4 {
    font-weight: 700;
}

/* Checkbox circle and tick styles for Steps 1 & 2 */
.tick-circle {
    transition: all 0.2s ease;
}

.airport-option input[type="checkbox"]:checked ~ .tick-circle,
.destination-option input[type="checkbox"]:checked ~ .tick-circle {
    border-color: rgb(79 70 229) !important;
    background-color: rgb(79 70 229) !important;
}

.airport-option input[type="checkbox"]:checked ~ .tick-circle .tick-icon,
.destination-option input[type="checkbox"]:checked ~ .tick-circle .tick-icon {
    opacity: 1 !important;
}

/* Make sure peer selectors work properly */
.airport-option .peer:checked ~ div .tick-circle,
.destination-option .peer:checked ~ div .tick-circle {
    border-color: rgb(79 70 229);
    background-color: rgb(79 70 229);
}

.airport-option .peer:checked ~ div .tick-icon,
.destination-option .peer:checked ~ div .tick-icon {
    opacity: 1;
}


@media (max-width: 900px) {
	.flex.items-center.justify-between .flex.items-center.gap-4 .w-10.h-10 { flex-shrink:0; }
	#search-results-container .md\:w-1\/3 { width:30%; }
	#search-results-container p.text-4xl { font-size: 1.75rem; }
	#search-results-container h2.mb-2.pt-20 { padding-top:3rem; }
	#search-results-container h3.text-xl { font-size: 1.1rem; }
	#search-results-container .flex.items-center.gap-4.p-6 { padding: 1.0rem; }
	
	#search-results-container .flex-shrink-0 .w-24 { width: 5rem; }
	#search-results-container .flex-shrink-0 .h-24 { height: 5rem; }
}

@media (max-width: 768px) {
  .main-title {
    padding: 0 !important;
  }
  #search-results-container .md\:w-1\/3 { width:100%; }
  .airline-option .w-\[60px\] { width:60px; }
  .airline-option .h-\[60px\] { height:60px; }
  #step-5-content .flex.flex-wrap.gap-3 { gap:0.5rem; }
}


@media (max-width: 500px) {
	.airline-option { background-color: white !important; }
	#step-1-container { border: 0; box-shadow:none; background:transparent; border-radius: 0; }
	#step-1-container .bg-gradient-to-r.from-indigo-50.to-white { padding: 1.5rem 0; background: transparent; border-top: 1px solid #e5e7eb; }
	#step-1-container #step-1-content .p-6 { padding: 1.5rem 0; }
	#step-1-container #step-1-summary { border-top: 1px solid #e5e7eb; padding:1rem 0; }
	
	#step-2-container { border: 0; box-shadow:none; background:transparent; border-radius: 0; margin-top:10px; }
	#step-2-container .bg-gradient-to-r.from-indigo-50.to-white { padding: 1.5rem 0; background: transparent; border-top: 1px solid #e5e7eb; }
	#step-2-container #step-2-content .p-6 { padding: 1.5rem 0; }
	#step-2-container #step-2-summary { border-top: 1px solid #e5e7eb; padding:1rem 0; }
	
	#step-3-container { border: 0; box-shadow:none; background:transparent; border-radius: 0; margin-top:10px; }
	#step-3-container .bg-gradient-to-r.from-indigo-50.to-white { padding: 1.5rem 0; background: transparent; border-top: 1px solid #e5e7eb; }
	#step-3-container #step-3-content .p-6 { padding: 1.5rem 0; }
	#step-3-container #step-3-summary { border-top: 1px solid #e5e7eb; padding:1rem 0; }
	
	#step-4-container { border: 0; box-shadow:none; background:transparent; border-radius: 0; margin-top:10px; }
	#step-4-container .bg-gradient-to-r.from-indigo-50.to-white { padding: 1.5rem 0; background: transparent; border-top: 1px solid #e5e7eb; }
	#step-4-container #step-4-content .p-6 { padding: 1.5rem 0; }
	#step-4-container #step-4-summary { border-top: 1px solid #e5e7eb; padding:1rem 0; }
	
	#step-5-container { border: 0; box-shadow:none; background:transparent; border-radius: 0; margin-top:10px; }
	#step-5-container .bg-gradient-to-r.from-indigo-50.to-white { padding: 1.5rem 0; background: transparent; border-top: 1px solid #e5e7eb; }
	#step-5-container #step-5-content .p-6 { padding: 1.5rem 0; }
	#step-5-container #step-5-summary { border-top: 1px solid #e5e7eb; padding:1rem 0; }
}
}