/**
 * MSM AI Itinerary Builder - Frontend Styles
 */

/* Container */
.msm-ai-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: "adrianna", Sans-serif;
    position: relative;
}

/* Subtle background pattern */
.msm-ai-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(1, 72, 104, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 115, 170, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(1, 72, 104, 0.01) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.msm-ai-form-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 40px 50px 50px;
    position: relative;
}

/* Progress Indicator */
.msm-ai-progress-indicator {
    margin-bottom: 50px;
    padding: 20px 0;
}

.msm-ai-progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 35px;
}

.msm-ai-progress-fill {
    height: 100%;
    background: #014868;
    transition: width 0.5s ease;
    position: relative;
}

.msm-ai-steps-indicator {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.msm-ai-step-dot {
    flex: 1;
    min-width: 80px;
    text-align: center;
    position: relative;
}

/* Connecting lines between steps */
.msm-ai-step-dot:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 24px;
    left: calc(50% + 24px);
    right: calc(-50% + 24px);
    height: 2px;
    background: #dee2e6;
    z-index: -1;
}

.msm-ai-step-dot.completed:not(:last-child)::after {
    background: #014868;
}

.msm-ai-step-dot span {
    display: inline-block;
    width: 48px;
    height: 48px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    color: #adb5bd;
    border-radius: 50%;
    line-height: 44px;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.msm-ai-step-dot.active span {
    background: #28a745;
    color: white;
    border-color: #28a745;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.25);
    font-size: 20px;
}

.msm-ai-step-dot.active span::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #28a745;
}

.msm-ai-step-dot.completed span {
    background: #014868;
    color: white;
    border-color: #014868;
    box-shadow: 0 2px 8px rgba(1, 72, 104, 0.2);
}

.msm-ai-step-dot.completed span::after {
    content: "✓";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

.msm-ai-step-dot label {
    display: block;
    font-size: 13px;
    color: #6c757d;
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.msm-ai-step-dot.active label {
    color: #212529;
    font-weight: 600;
}

.msm-ai-step-dot.completed label {
    color: #014868;
    font-weight: 500;
}

/* Typography */
.msm-ai-container h2 {
    color: #014868;
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.msm-ai-container h3 {
    color: #014868;
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 15px;
}

.msm-ai-container h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #014868 0%, #0073aa 100%);
    border-radius: 2px;
}

.msm-ai-intro {
    text-align: center;
    color: #6c757d;
    font-size: 19px;
    margin-bottom: 45px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Form Steps */
.msm-ai-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.msm-ai-step.active {
    display: block;
}

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

/* Destination Cards */
.msm-ai-destination-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.msm-ai-destination-card {
    position: relative;
    display: block;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    overflow: hidden;
}

.msm-ai-destination-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(1, 72, 104, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.msm-ai-destination-card:hover {
    border-color: #014868;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(1, 72, 104, 0.15);
}

.msm-ai-destination-card:hover::before {
    opacity: 1;
}

.msm-ai-destination-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.msm-ai-destination-card input[type="radio"]:checked + .msm-ai-card-content {
    color: #014868;
}

.msm-ai-destination-card input[type="radio"]:checked ~ .msm-ai-card-content::before {
    content: "✓";
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #014868 0%, #0073aa 100%);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(1, 72, 104, 0.3);
}

.msm-ai-destination-card input[type="radio"]:checked ~ .msm-ai-card-content {
    transform: scale(1.02);
}

.msm-ai-destination-card h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.msm-ai-destination-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.msm-ai-destination-card input[type="radio"]:checked ~ * {
    color: #014868;
}

.msm-ai-destination-card input[type="radio"]:checked ~ * p {
    color: #014868;
}

/* Form Fields */
.msm-ai-field-group {
    margin-bottom: 25px;
}

.msm-ai-field-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #014868;
    font-size: 16px;
    letter-spacing: 0.2px;
}

.msm-ai-field-group input[type="text"],
.msm-ai-field-group input[type="email"],
.msm-ai-field-group input[type="tel"],
.msm-ai-field-group input[type="date"],
.msm-ai-field-group input[type="number"],
.msm-ai-field-group select,
.msm-ai-field-group textarea {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 18px;
    font-family: "adrianna", Sans-serif;
    transition: all 0.3s;
    background: #ffffff;
    color: #495057;
}

/* Style date inputs to match design */
.msm-ai-field-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
}

.msm-ai-field-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.msm-ai-field-group textarea {
    resize: vertical;
    min-height: 100px;
}

.msm-ai-field-group input:hover,
.msm-ai-field-group select:hover,
.msm-ai-field-group textarea:hover {
    border-color: #adb5bd;
}

.msm-ai-field-group input:focus,
.msm-ai-field-group select:focus,
.msm-ai-field-group textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Checkboxes and Radios */
.msm-ai-checkbox-group,
.msm-ai-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.msm-ai-checkbox-group label,
.msm-ai-radio-group label {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.msm-ai-checkbox-group label:hover,
.msm-ai-radio-group label:hover {
    background: #f8f9fa;
    border-color: #014868;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.msm-ai-checkbox-group input[type="checkbox"],
.msm-ai-radio-group input[type="radio"] {
    margin-right: 8px;
}

/* Child Ages */
.msm-ai-child-ages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.msm-ai-child-age-field {
    display: flex;
    flex-direction: column;
}

.msm-ai-child-age-field label {
    font-size: 14px;
    margin-bottom: 4px;
}

.msm-ai-child-age-field input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

/* Buttons */
.msm-ai-btn {
    padding: 12px 40px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    min-width: 140px;
}

.msm-ai-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.msm-ai-btn:active {
    transform: translateY(0);
}

.msm-ai-btn-next,
.msm-ai-btn-generate,
.msm-ai-btn-submit {
    background: #0073aa;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.msm-ai-btn-next:hover,
.msm-ai-btn-generate:hover,
.msm-ai-btn-submit:hover {
    background: #005a87;
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
}

.msm-ai-btn-prev {
    background: #6c757d;
    color: white;
    margin-right: 20px;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.msm-ai-btn-prev:hover {
    background: #5a6268;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.4);
}

.msm-ai-btn-restart {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.msm-ai-btn-restart:hover {
    background: linear-gradient(135deg, #218838 0%, #1cb782 100%);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.3);
}

/* Form Navigation */
.msm-ai-form-navigation {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e0e0e0;
}

/* Loading State */
.msm-ai-loading {
    text-align: center;
    padding: 60px;
}

.msm-ai-spinner {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    margin-bottom: 30px;
}

.msm-ai-spinner::before,
.msm-ai-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.msm-ai-spinner::before {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #014868 0%, #0073aa 50%, #014868 100%);
    animation: magicSpin 2s linear infinite;
}

.msm-ai-spinner::after {
    width: 70%;
    height: 70%;
    background: white;
    top: 15%;
    left: 15%;
}

@keyframes magicSpin {
    0% { 
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
        opacity: 0.8;
    }
    100% { 
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

.msm-ai-loading p {
    font-size: 20px;
    color: #014868;
    font-weight: 500;
    animation: fadeInOut 2s ease-in-out infinite;
}

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

/* Magic sparkles */
.msm-ai-loading::before {
    content: "✨";
    position: absolute;
    font-size: 24px;
    animation: float1 3s ease-in-out infinite;
    left: 20%;
    top: 20%;
}

.msm-ai-loading::after {
    content: "🌟";
    position: absolute;
    font-size: 20px;
    animation: float2 3s ease-in-out infinite;
    right: 25%;
    bottom: 30%;
}

@keyframes float1 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.2); }
}

/* Results */
.msm-ai-results {
    animation: fadeIn 0.5s ease-in-out;
}

/* Itinerary Cards */
.msm-ai-day-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.msm-ai-day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #014868 0%, #0073aa 100%);
}

.msm-ai-day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.msm-ai-day-card h3 {
    color: #014868;
    margin-bottom: 20px;
    padding-left: 15px;
}

.msm-ai-time-block {
    margin-bottom: 20px;
}

.msm-ai-time-block h4 {
    color: #014868;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.msm-ai-time-block h4::before {
    content: '🏰';
    margin-right: 8px;
    font-size: 20px;
}

.msm-ai-time-block p {
    color: #495057;
    line-height: 1.8;
    padding-left: 28px;
}

.msm-ai-highlights {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 18px;
    border-radius: 12px;
    margin-top: 20px;
    color: #014868;
    border-left: 4px solid #014868;
    font-weight: 500;
}

/* Lead Capture */
.msm-ai-lead-capture {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border: 2px solid #014868;
    border-radius: 20px;
    padding: 40px;
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}

.msm-ai-lead-capture::before {
    content: '✨';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    opacity: 0.1;
}

.msm-ai-lead-capture h3 {
    color: #014868;
    text-align: center;
    font-size: 32px;
    margin-bottom: 15px;
}

.msm-ai-lead-capture > p {
    text-align: center;
    font-size: 19px;
    color: #495057;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Trust Badges */
.msm-ai-trust-badges {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.msm-ai-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.msm-ai-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.msm-ai-badge-icon {
    font-size: 28px;
}

.msm-ai-badge-text {
    font-size: 14px;
    font-weight: 600;
    color: #014868;
    letter-spacing: 0.2px;
}

/* Social Proof */
.msm-ai-social-proof {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.msm-ai-testimonial {
    font-style: italic;
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.msm-ai-testimonial-author {
    font-size: 14px;
    color: #666;
    text-align: right;
    margin: 0;
}

/* Thank You */
.msm-ai-thank-you {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.5s ease-in-out;
}

.msm-ai-thank-you h2 {
    color: #28a745;
    margin-bottom: 24px;
}

.msm-ai-thank-you p {
    font-size: 18px;
    color: #666;
    margin-bottom: 32px;
}

/* Error Messages */
.msm-ai-error {
    background: #f8d7da;
    color: #721c24;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .msm-ai-container {
        padding: 20px 15px;
    }
    
    .msm-ai-form-wrapper {
        padding: 30px 20px;
        border-radius: 15px;
    }
    
    .msm-ai-progress-indicator {
        padding: 20px 15px;
    }
    
    .msm-ai-steps-indicator {
        display: none;
    }
    
    .msm-ai-container h2 {
        font-size: 28px;
    }
    
    .msm-ai-container h3 {
        font-size: 22px;
    }
    
    .msm-ai-intro {
        font-size: 16px;
    }
    
    .msm-ai-destination-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .msm-ai-checkbox-group,
    .msm-ai-radio-group {
        grid-template-columns: 1fr;
    }
    
    .msm-ai-form-navigation {
        flex-direction: column;
        gap: 12px;
    }
    
    .msm-ai-btn {
        width: 100%;
        text-align: center;
        padding: 16px 24px;
    }
    
    .msm-ai-btn-prev {
        margin-right: 0;
    }
    
    .msm-ai-trust-badges {
        flex-direction: column;
        gap: 15px;
    }
    
    .msm-ai-badge {
        width: 100%;
        justify-content: center;
    }
    
    .msm-ai-lead-capture {
        padding: 30px 20px;
    }
    
    .msm-ai-day-card {
        padding: 20px;
    }
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msm-ai-step.active {
    animation: slideInUp 0.4s ease-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.msm-ai-btn:focus,
.msm-ai-field-group input:focus,
.msm-ai-field-group select:focus,
.msm-ai-field-group textarea:focus,
.msm-ai-checkbox-group input:focus,
.msm-ai-radio-group input:focus {
    outline: 3px solid rgba(1, 72, 104, 0.3);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .msm-ai-form-wrapper,
    .msm-ai-lead-capture,
    .msm-ai-btn {
        display: none;
    }
    
    .msm-ai-day-card {
        page-break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 20px;
    }
}