/* Onboarding Flow UI Styles */

/* Modal Overlay */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Modal Container */
.onboarding-modal {
    background: linear-gradient(180deg, #0f1724 0%, #0b1220 100%);
    border: 1px solid #20313c;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.onboarding-overlay.active .onboarding-modal {
    transform: scale(1) translateY(0);
}

/* Header with Progress */
.onboarding-header {
    background: linear-gradient(135deg, #1a2332 0%, #0f1724 100%);
    padding: 20px 24px;
    border-bottom: 1px solid #20313c;
    flex-shrink: 0;
}

.onboarding-title {
    color: #cfe8ff;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.onboarding-title .emoji {
    font-size: 1.6rem;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-steps {
    display: flex;
    gap: 4px;
    flex: 1;
}

.progress-step {
    height: 6px;
    flex: 1;
    background: #20313c;
    border-radius: 3px;
    transition: background 0.3s ease;
    cursor: pointer;
}

.progress-step.completed {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
}

.progress-step.active {
    background: linear-gradient(135deg, #5aa8ff 0%, #1e88e5 100%);
}

/* Final step should show green (completed) not blue (active) */
.progress-step.active.completed {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
}

.progress-text {
    color: #9fbfff;
    font-size: 0.85rem;
    min-width: 45px;
    text-align: right;
}

/* Content Area */
.onboarding-content {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Step Sections */
.onboarding-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.onboarding-step.active {
    display: block;
}

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

/* Step Headers */
.step-header {
    margin-bottom: 20px;
}

.step-title {
    color: #e6eef8;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.step-subtitle {
    color: #9fbfff;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
}

/* Welcome Step */
.welcome-hero {
    text-align: center;
    padding: 20px 0;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.welcome-title {
    color: #cfe8ff;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.welcome-subtitle {
    color: #9fbfff;
    font-size: 1.1rem;
    margin: 0 0 24px 0;
}

.welcome-features {
    text-align: left;
    background: rgba(90, 168, 255, 0.08);
    border: 1px solid rgba(90, 168, 255, 0.2);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.welcome-features h4 {
    color: #5aa8ff;
    font-size: 1rem;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    color: #dbeaf7;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.feature-list li::before {
    content: "✓";
    color: #4caf50;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Program Grid */
.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.program-card {
    background: #17212a;
    border: 1px solid #20313c;
    border-radius: 10px;
    padding: 14px;
    transition: all 0.2s ease;
}

.program-card:hover {
    border-color: #5aa8ff;
    background: #1a2532;
}

.program-card.has-value {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.program-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.program-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.program-icon.airline {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
}

.program-icon.bank {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
}

.program-icon.hotel {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
}

.program-name {
    color: #dbeaf7;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
}

.program-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #20313c;
    background: #0b1220;
    color: #e6eef8;
    font-size: 0.95rem;
    text-align: right;
}

.program-input:focus {
    outline: none;
    border-color: #5aa8ff;
    box-shadow: 0 0 0 3px rgba(90, 168, 255, 0.15);
}

.program-input::placeholder {
    color: #4a5568;
}

/* Preferences Step */
.preference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.preference-item {
    background: #17212a;
    border: 1px solid #20313c;
    border-radius: 10px;
    padding: 16px;
}

.preference-label {
    color: #cfe8ff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.preference-help {
    color: #7a8fa8;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.preference-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #20313c;
    background: #0b1220;
    color: #e6eef8;
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239fbfff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.preference-select:focus {
    outline: none;
    border-color: #5aa8ff;
    box-shadow: 0 0 0 3px rgba(90, 168, 255, 0.15);
}

/* Point Value Slider */
.slider-container {
    margin-top: 8px;
}

.slider-value {
    color: #5aa8ff;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.preference-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #20313c;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.preference-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5aa8ff 0%, #1e88e5 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.preference-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5aa8ff 0%, #1e88e5 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #7a8fa8;
}

/* Airline Multi-Select */
.airline-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.airline-chip {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid #20313c;
    background: #17212a;
    color: #9fbfff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.airline-chip:hover {
    border-color: #5aa8ff;
    background: #1a2532;
}

.airline-chip.selected {
    border-color: #5aa8ff;
    background: rgba(90, 168, 255, 0.2);
    color: #5aa8ff;
}

/* Confirmation Step */
.confirmation-summary {
    background: #17212a;
    border: 1px solid #20313c;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.summary-section {
    padding: 16px 0;
    border-bottom: 1px solid #20313c;
}

.summary-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-section:first-child {
    padding-top: 0;
}

.summary-label {
    color: #7a8fa8;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    color: #e6eef8;
    font-size: 1.1rem;
    font-weight: 600;
}

.summary-value.highlight {
    color: #4caf50;
    font-size: 1.3rem;
}

.summary-programs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.summary-program-badge {
    background: rgba(90, 168, 255, 0.15);
    border: 1px solid rgba(90, 168, 255, 0.3);
    border-radius: 16px;
    padding: 4px 12px;
    color: #5aa8ff;
    font-size: 0.85rem;
}

.summary-preferences {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.summary-pref-item {
    color: #dbeaf7;
    font-size: 0.9rem;
}

.summary-pref-item .label {
    color: #7a8fa8;
    margin-right: 8px;
}

/* Footer with Navigation */
.onboarding-footer {
    background: #0f1724;
    border-top: 1px solid #20313c;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.footer-left {
    display: flex;
    align-items: center;
}

.skip-link {
    color: #7a8fa8;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.skip-link:hover {
    color: #9fbfff;
}

.footer-right {
    display: flex;
    gap: 10px;
}

.btn-back {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #20313c;
    background: transparent;
    color: #9fbfff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    border-color: #5aa8ff;
    color: #5aa8ff;
}

.btn-next {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-next:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.4);
}

.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-complete {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
}

.btn-complete:hover {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Loading State */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@keyframes btn-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success Animation */
.success-animation {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 5rem;
    animation: bounceIn 0.6s ease;
}

.success-title {
    color: #4caf50;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 20px 0 10px;
}

.success-message {
    color: #9fbfff;
    font-size: 1rem;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Skip Hint */
.skip-hint {
    text-align: center;
    margin-top: 16px;
}

.skip-hint-text {
    color: #7a8fa8;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
    .onboarding-modal {
        width: 95%;
        max-height: 90vh;
        margin: 10px;
    }
    
    .onboarding-header {
        padding: 16px;
    }
    
    .onboarding-content {
        padding: 16px;
    }
    
    .program-grid {
        grid-template-columns: 1fr;
    }
    
    .preference-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-preferences {
        grid-template-columns: 1fr;
    }
    
    .onboarding-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-right {
        width: 100%;
        justify-content: stretch;
    }
    
    .btn-back, .btn-next {
        flex: 1;
    }
}

/* ========================================
   COMPOSE MODAL STYLES
   ======================================== */

/* Compose Modal Overlay - reuses onboarding overlay pattern */
.compose-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Compose Modal Container */
.compose-modal {
    background: linear-gradient(180deg, #0f1724 0%, #0b1220 100%);
    border: 1px solid #20313c;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.compose-overlay.active .compose-modal {
    transform: scale(1) translateY(0);
}

/* Compose Header */
.compose-header {
    background: linear-gradient(135deg, #1a2332 0%, #0f1724 100%);
    padding: 24px;
    border-bottom: 1px solid #20313c;
    text-align: center;
    flex-shrink: 0;
}

.compose-title {
    color: #cfe8ff;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.compose-title .emoji {
    font-size: 1.8rem;
}

.compose-subtitle {
    color: #7a8fa8;
    font-size: 0.95rem;
    margin: 8px 0 0 0;
}

/* Compose Content */
.compose-content {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Compose Textarea */
.compose-textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #20313c;
    background: #07101a;
    color: #e6eef8;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.compose-textarea:focus {
    outline: none;
    border-color: #5aa8ff;
    box-shadow: 0 0 0 3px rgba(90, 168, 255, 0.15);
}

.compose-textarea::placeholder {
    color: #4a5568;
}

/* Compose Suggestions */
.compose-suggestions {
    margin-top: 20px;
}

.compose-suggestions-title {
    color: #7a8fa8;
    font-size: 0.85rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compose-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.compose-suggestion-btn {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #20313c;
    background: #0b1520;
    color: #dbeaf7;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.compose-suggestion-btn:hover {
    border-color: #5aa8ff;
    background: #17212a;
    color: #fff;
}

.compose-suggestion-btn:focus {
    outline: none;
    border-color: #5aa8ff;
    box-shadow: 0 0 0 3px rgba(90, 168, 255, 0.15);
}

/* Compose Footer */
.compose-footer {
    background: #0f1724;
    border-top: 1px solid #20313c;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.compose-footer-left {
    display: flex;
    align-items: center;
}

.compose-skip-link {
    color: #7a8fa8;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.compose-skip-link:hover {
    color: #9fbfff;
}

.compose-footer-right {
    display: flex;
    gap: 10px;
}

.compose-btn-cancel {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #20313c;
    background: transparent;
    color: #9fbfff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.compose-btn-cancel:hover {
    border-color: #5aa8ff;
    color: #5aa8ff;
}

.compose-btn-start {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compose-btn-start:hover {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.compose-btn-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Compose Modal Responsive */
@media (max-width: 600px) {
    .compose-modal {
        width: 95%;
        max-height: 90vh;
        margin: 10px;
    }
    
    .compose-header {
        padding: 20px 16px;
    }
    
    .compose-title {
        font-size: 1.3rem;
    }
    
    .compose-content {
        padding: 16px;
    }
    
    .compose-suggestions-grid {
        grid-template-columns: 1fr;
    }
    
    .compose-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .compose-footer-right {
        width: 100%;
    }
    
    .compose-btn-cancel, .compose-btn-start {
        flex: 1;
    }
}
