/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f28241 0%, #FF634D 50%, #FF8EC6 100%);
    min-height: 100vh;
    color: #000000;
    line-height: 1.6;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Screen management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Header Card */
.header-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 1rem;
}

.header-logo {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 0;
    position: relative;
}

.header h1 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.subtitle {
    color: #666;
    font-size: 1rem;
    margin-bottom: 0;
    font-weight: 400;
}

.page-description {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.page-description p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

#user-greeting {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 400;
    word-wrap: break-word; /* Handle long names gracefully */
}

/* Buttons */
.btn-primary {
    background: #FF634D;
    color: #f7eee9;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    width: 100%;
}

.btn-primary:hover {
    background: #f28241;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 99, 77, 0.3);
}

.btn-primary.large {
    padding: 20px 24px;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline {
    background: #f7eee9;
    color: #f28241;
    border: 2px solid #f28241;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    flex: 1;
}

.btn-outline:hover {
    background: #f28241;
    color: #f7eee9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(242, 130, 65, 0.3);
}

.btn-back {
    position: absolute;
    left: 0;
    top: 0;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-back:hover {
    background: #e9e9e9;
    border-color: #ccc;
}

.btn-back-standalone {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: auto !important;
    max-width: fit-content;
}

.btn-back-standalone:hover {
    background: #e9e9e9;
    border-color: #ccc;
}


/* Forms */
.auth-form, .refer-form {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f28241;
    background: white;
}

.new-user-fields {
    border-top: 1px solid #e1e1e1;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.contact-note {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
}


/* Main actions */
.main-actions {
    margin-top: 3rem;
    margin-bottom: 0;
}

.main-actions .btn-outline {
    width: 100%;
}

/* Referrals section */
.referrals-section h2 {
    color: #f7eee9;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.referrals-list {
    display: grid;
    gap: 1rem;
}

.referral-tile {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.referral-tile:hover {
    transform: translateY(-2px);
}

.referral-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.referral-header h3 {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

.referral-status {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.referral-status.status-pending {
    background: #fff3e0;
    color: #f57c00;
}

.referral-status.status-redeemed {
    background: #f5f5f5;
    color: #757575;
}

.referral-status.status-booked {
    background: #e1f5fe;
    color: #0277bd;
}


.referral-status.status-reward_available {
    background: #e8f5e8;
    color: #2e7d32;
    animation: pulse 2s infinite;
}

.referral-card.redeemed {
    opacity: 0.6;
    background: #fafafa;
}

/* Status Clickable Styles */
.status-clickable-container {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.status-info-icon {
    margin-left: 4px;
    opacity: 0.7;
    font-size: 0.9em;
    font-weight: normal;
    transition: opacity 0.2s ease;
}

.status-clickable-container:hover .status-info-icon {
    opacity: 1;
}

/* Status Details Expansion */
.status-details {
    display: none;
    margin-bottom: 12px;
    padding: 12px;
    background: #2c3e50;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    animation: slideDown 0.3s ease-out;
}

.status-details.expanded {
    display: block;
}

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

.status-details-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #ecf0f1;
    font-size: 0.9rem;
}

.status-details-description {
    margin-bottom: 8px;
    color: #bdc3c7;
    font-size: 0.85rem;
    line-height: 1.4;
}

.status-details-next {
    color: #74b9ff;
    font-weight: 500;
    font-size: 0.85rem;
}

.referral-details {
    color: #666;
    font-size: 0.9rem;
}

/* Book a Trip Card */
.book-trip-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.book-trip-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.book-trip-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.book-trip-card h3 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.book-trip-card p {
    color: #666;
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

.book-trip-card .btn-primary {
    margin-top: 0.5rem;
    min-width: 150px;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 2rem;
    padding: 1rem;
}

.footer-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}


.contact-info {
    margin: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reward-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f0f8f0;
    border-radius: 8px;
    color: #2e7d32;
    font-weight: 600;
    border-left: 4px solid #FF8EC6;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.referral-date {
    display: inline-block;
    background: #e8f4fd;
    color: #2c5aa0;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #b8daff;
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.referral-contact {
    color: #666;
    font-size: 0.9rem;
}

.referral-reward {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e1e1;
}

.reward-available {
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.redeem-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.redeem-btn:hover {
    background: #45a049;
}

/* Status messages */
.status-message {
    margin-top: 1rem;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.status-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.status-message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.status-message.info {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

/* Loading */
.loading {
    text-align: center;
    color: rgba(247, 238, 233, 0.8);
    font-style: italic;
    padding: 2rem;
}

/* Success/Error screens */
.success-content,
.error-content {
    text-align: center;
    background: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 2rem;
}

.success-icon,
.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-content h1,
.error-content h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.success-content p,
.error-content p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Communication options */
.communication-options {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.communication-options h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.comm-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Single communication button takes full width when the other is hidden */
.comm-buttons .btn-primary[style*="display: none"] + .btn-outline,
.comm-buttons .btn-outline[style*="display: none"] + .btn-primary,
.comm-buttons .btn-primary:only-child,
.comm-buttons .btn-outline:only-child {
    grid-column: 1 / -1;
}

/* Alternative approach: when one button is hidden, make the visible one full width */
.comm-buttons:has(.btn-primary[style*="display: none"]) .btn-outline,
.comm-buttons:has(.btn-outline[style*="display: none"]) .btn-primary {
    grid-column: 1 / -1;
}

.comm-buttons .btn-primary,
.comm-buttons .btn-outline {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.9rem;
}

/* Info links */
.info-links {
    text-align: center;
    margin-top: auto;
    padding-top: 2rem;
}

.info-links a {
    color: rgba(247, 238, 233, 0.8);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.info-links a:hover {
    color: #f7eee9;
}

/* Rules blurb */
.rules-blurb {
    background: rgba(247, 238, 233, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    color: rgba(247, 238, 233, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Responsive design */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }
    
    .header-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .header-logo {
        max-height: 60px;
    }
    
    #user-greeting {
        font-size: 1rem;
    }
    
    .footer-links {
        gap: 1.5rem;
        margin-top: 2rem;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-link {
        font-size: 0.85rem;
    }
    
    .auth-form, .refer-form {
        padding: 1.5rem;
    }
    
    .comm-buttons {
        grid-template-columns: 1fr;
    }
}
/*
 Reward Redemption Styles */
.redemption-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.redemption-intro {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #333;
}

.reward-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reward-option {
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.reward-option:hover {
    border-color: #4CAF50;
    background: #f8fff8;
}

.reward-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.reward-option h3 {
    color: #333;
    font-size: 1.1rem;
    margin: 0;
}

.reward-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4CAF50;
}

.select-reward-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.select-reward-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.gifted-credit-form {
    margin-top: 2rem;
}

.gifted-credit-form h3 {
    color: #333;
    margin-bottom: 1rem;
}

.gifted-credit-form p {
    color: #666;
    margin-bottom: 1.5rem;
}

.redemption-confirmation {
    margin-top: 2rem;
}

.redemption-confirmation h3 {
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

.confirmation-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 600;
    color: #333;
}

.detail-row .value {
    color: #666;
}

.gift-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.confirmation-actions {
    display: flex;
    gap: 1rem;
}

.confirmation-actions button {
    flex: 1;
}

.redemption-success {
    text-align: center;
    margin-top: 2rem;
}

.redemption-success .success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.redemption-success h2 {
    color: #4CAF50;
    margin-bottom: 1.5rem;
}

.success-details {
    background: #f8fff8;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #c8e6c9;
}

.success-details p {
    margin-bottom: 0.5rem;
    color: #333;
}

.auto-close-note {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Referral tile reward button */
.redeem-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
}

.redeem-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.referral-tile.has-reward {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
}

.reward-info {
    background: #e8f5e8;
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #2e7d32;
    font-weight: 600;
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: confetti-fall linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    color: #666;
    font-weight: 300;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.modal-body {
    padding: 60px 40px 40px;
    overflow-y: auto;
    max-height: 90vh;
    color: #333;
    line-height: 1.6;
}

.modal-body h1 {
    color: #f28241;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.modal-body h2 {
    color: #f28241;
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
    font-weight: 600;
}

.modal-body h3 {
    color: #FF634D;
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
    font-weight: 600;
}

.modal-body p {
    margin-bottom: 1rem;
    color: #444;
}

.modal-body ul,
.modal-body ol {
    margin: 1rem 0 1rem 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    color: #444;
}

.modal-body hr {
    border: none;
    border-top: 2px solid #eee;
    margin: 2rem 0;
}

.reward-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reward-table th {
    background: #f28241;
    color: white;
    padding: 12px 8px;
    font-weight: 600;
    text-align: left;
    font-size: 0.85rem;
}

.reward-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    color: #444;
}

.reward-table tbody tr:hover {
    background: rgba(242, 130, 65, 0.05);
}

.reward-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive adjustments for modal */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-body {
        padding: 50px 20px 20px;
    }
    
    .modal-body h1 {
        font-size: 1.5rem;
    }
    
    .modal-body h2 {
        font-size: 1.2rem;
    }
    
    .modal-body h3 {
        font-size: 1.1rem;
    }
    
    .reward-table {
        font-size: 0.8rem;
    }
    
    .reward-table th,
    .reward-table td {
        padding: 8px 6px;
    }
    
    .reward-table th {
        font-size: 0.75rem;
    }
}

@media (max-width: 600px) {
    .reward-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .reward-table th,
    .reward-table td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
}

/* Responsive adjustments for reward redemption */
@media (max-width: 480px) {
    .reward-option-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .confirmation-actions {
        flex-direction: column;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}