/**
 * Guest Job Request Modal - Dark Mode UI styling
 * Inherits styling from desktop job request modal for consistency
 */

/* Modal background and container styling - same as desktop modal */
#guestJobRequestModal .modal-content.dark-mode-modal {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    background: linear-gradient(145deg, #1e1e1e, #121212);
    border: 1px solid rgba(255, 152, 0, 0.1);
    color: #fff;
    animation: modalFadeIn 0.3s ease;
}

/* Orange gradient header - identical to desktop modal */
#guestJobRequestModal .modal-header.orange-gradient {
    background: linear-gradient(90deg, #ff9800, #ff5722);
    border-bottom: none;
    padding: 0.8rem 1.2rem;
    position: relative;
    overflow: hidden;
}

#guestJobRequestModal .modal-header.orange-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255, 152, 0, 0.8), rgba(255, 87, 34, 0.9));
    opacity: 0.8;
    z-index: -1;
}

#guestJobRequestModal .modal-header h5 {
    font-weight: 700;
    color: white;
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

#guestJobRequestModal .modal-body.dark-bg {
    padding: 0;
    background-color: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
}

/* Card design with orange accents - same as desktop modal */
#guestJobRequestModal .card {
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.9), rgba(20, 20, 20, 0.95));
    border: 1px solid rgba(255, 152, 0, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    color: #fff;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#guestJobRequestModal .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 152, 0, 0.1);
}

/* Form styling - consistent with desktop modal */
#guestJobRequestModal .form-control,
#guestJobRequestModal .form-select {
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 152, 0, 0.2);
    color: #fff;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#guestJobRequestModal .form-control:focus,
#guestJobRequestModal .form-select:focus {
    background: rgba(50, 50, 50, 0.9);
    border-color: #ff9800;
    box-shadow: 0 0 0 0.2rem rgba(255, 152, 0, 0.15);
    color: #fff;
}

#guestJobRequestModal .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Button styling - consistent with desktop modal */
#guestJobRequestModal .btn-primary {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

#guestJobRequestModal .btn-primary:hover {
    background: linear-gradient(135deg, #f57c00, #e64a19);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

#guestJobRequestModal .btn-secondary {
    background: rgba(60, 60, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

#guestJobRequestModal .btn-secondary:hover {
    background: rgba(80, 80, 80, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

#guestJobRequestModal .btn-success {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

#guestJobRequestModal .btn-success:hover {
    background: linear-gradient(135deg, #388e3c, #1b5e20);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Auth choice cards */
#guestJobRequestModal .auth-choice-card {
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.9), rgba(20, 20, 20, 0.95));
    border: 1px solid rgba(255, 152, 0, 0.15);
}

#guestJobRequestModal .auth-choice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.3);
}

/* Form text and help text */
#guestJobRequestModal .form-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

/* Override Bootstrap text-muted to be more visible white text */
#guestJobRequestModal .text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Make all text elements white by default */
#guestJobRequestModal p,
#guestJobRequestModal small,
#guestJobRequestModal span,
#guestJobRequestModal div:not(.card):not(.modal-header):not(.modal-footer):not(.btn) {
    color: rgba(255, 255, 255, 0.9);
}

/* Specific overrides for better visibility */
#guestJobRequestModal .small {
    color: rgba(255, 255, 255, 0.85);
}

/* Character counter text */
#guestJobRequestModal .text-danger {
    color: #ff6b6b !important;
}

#guestJobRequestModal .text-success {
    color: #51cf66 !important;
}

/* Character counter */
#guestJobRequestModal #guest-char-counter {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

#guestJobRequestModal #guest-char-counter.text-success {
    color: #4caf50 !important;
}

/* Step animation */
#guestJobRequestModal .step-form {
    animation: slideIn 0.3s ease-in-out;
}

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

/* Modal footer */
#guestJobRequestModal .modal-footer {
    background: rgba(20, 20, 20, 0.8);
    border-top: 1px solid rgba(255, 152, 0, 0.1);
    padding: 1rem 1.5rem;
}

/* Progress indicator (if needed) */
#guestJobRequestModal .step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

#guestJobRequestModal .step-indicator .step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(60, 60, 60, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.5rem;
    font-size: 0.875rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

#guestJobRequestModal .step-indicator .step.active {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
}

#guestJobRequestModal .step-indicator .step.completed {
    background: #4caf50;
    color: white;
}

/* Stripe Elements styling with maximum contrast and visibility */
#guestJobRequestModal #guest-card-element,
#guestJobRequestModal .StripeElement,
#guestJobRequestModal [data-testid="card-element"],
#guestJobRequestModal iframe[src*="stripe"] {
    background: #2d2d2d !important;
    border: 2px solid #ff9800 !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    min-height: 60px !important;
    transition: all 0.3s ease !important;
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 500 !important;
}

#guestJobRequestModal #guest-card-element.StripeElement--focus,
#guestJobRequestModal .StripeElement.StripeElement--focus {
    border-color: #ff9800 !important;
    box-shadow: 0 0 0 0.3rem rgba(255, 152, 0, 0.4) !important;
    background: #3a3a3a !important;
}

/* Force all input elements inside Stripe Elements to be visible */
#guestJobRequestModal #guest-card-element *,
#guestJobRequestModal .StripeElement *,
#guestJobRequestModal [data-testid="card-element"] * {
    color: #ffffff !important;
    background: transparent !important;
    font-size: 18px !important;
    font-weight: 500 !important;
}

/* Target placeholder text specifically */
#guestJobRequestModal #guest-card-element ::placeholder,
#guestJobRequestModal .StripeElement ::placeholder,
#guestJobRequestModal [data-testid="card-element"] ::placeholder {
    color: #cccccc !important;
    opacity: 1 !important;
    font-size: 16px !important;
}

/* Override any Stripe inline styles */
#guestJobRequestModal #guest-card-element[style],
#guestJobRequestModal .StripeElement[style] {
    background: #2d2d2d !important;
    color: #ffffff !important;
}

/* Ensure iframe content is styled */
#guestJobRequestModal iframe[src*="stripe"] {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* Enhanced error styling */
#guestJobRequestModal #guest-card-errors {
    color: #ff4757;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 8px;
    border-left: 3px solid #ff4757;
    display: none;
}

/* Payment processing state */
#guestJobRequestModal .payment-processing {
    opacity: 0.7;
    pointer-events: none;
}

#guestJobRequestModal .payment-processing #guest-card-element {
    background: rgba(60, 60, 60, 0.5);
    border-color: rgba(255, 152, 0, 0.1);
}

/* FORCE all text in step 2 to be dark - nuclear option */
#guestJobRequestModal #guest-step-2,
#guestJobRequestModal #guest-step-2 *,
#guestJobRequestModal #guest-step-2 .card-title,
#guestJobRequestModal #guest-step-2 .text-white,
#guestJobRequestModal #guest-step-2 .fw-bold,
#guestJobRequestModal #guest-step-2 div,
#guestJobRequestModal #guest-step-2 span,
#guestJobRequestModal #guest-step-2 .card-body,
#guestJobRequestModal #guest-step-2 .card-body *,
#guestJobRequestModal #guest-step-2 .d-flex,
#guestJobRequestModal #guest-step-2 .text-end,
#guestJobRequestModal #guest-step-2 .text-warning,
#guestJobRequestModal #guest-step-2 .text-muted,
#guestJobRequestModal #guest-step-2 small {
    color: #000 !important;
    background-color: transparent !important;
}

/* Mobile responsive overrides - sizing only */
@media (max-width: 768px) {
    /* Mobile modal dialog sizing */
    #guestJobRequestModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    /* Remove card styling that conflicts with light theme */
    
    /* EXACT same form controls as desktop */
    #guestJobRequestModal .form-control,
    #guestJobRequestModal .form-select {
        background: rgba(40, 40, 40, 0.8) !important;
        border: 1px solid rgba(255, 152, 0, 0.2) !important;
        color: #fff !important;
        border-radius: 12px !important;
        padding: 0.75rem 1rem !important;
        transition: all 0.3s ease !important;
        backdrop-filter: blur(5px) !important;
    }
    
    #guestJobRequestModal .form-control:focus,
    #guestJobRequestModal .form-select:focus {
        background: rgba(50, 50, 50, 0.9) !important;
        border-color: #ff9800 !important;
        box-shadow: 0 0 0 0.2rem rgba(255, 152, 0, 0.15) !important;
        color: #fff !important;
    }
    
    #guestJobRequestModal .form-control::placeholder {
        color: rgba(255, 255, 255, 0.6) !important;
    }
    
    /* EXACT same button styling as desktop */
    #guestJobRequestModal .btn-primary {
        background: linear-gradient(135deg, #ff9800, #ff5722) !important;
        border: none !important;
        border-radius: 12px !important;
        padding: 0.75rem 2rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
        text-transform: uppercase !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3) !important;
    }
    
    #guestJobRequestModal .btn-secondary {
        background: rgba(60, 60, 60, 0.8) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        color: #fff !important;
        border-radius: 12px !important;
        padding: 0.75rem 2rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
        text-transform: uppercase !important;
        transition: all 0.3s ease !important;
    }
    
    /* EXACT same modal footer as desktop */
    #guestJobRequestModal .modal-footer {
        border-top: 1px solid rgba(255, 152, 0, 0.1) !important;
        background-color: rgba(20, 20, 20, 0.8) !important;
        padding: 0.8rem 1rem !important;
    }
    
    /* Force all text to be white */
    #guestJobRequestModal *:not(.btn) {
        color: #fff !important;
    }
    
    #guestJobRequestModal .text-muted {
        color: rgba(255, 255, 255, 0.7) !important;
    }
    
    /* Character counter */
    #guestJobRequestModal #guest-char-counter {
        color: rgba(255, 152, 0, 0.8) !important;
        font-size: 0.8rem !important;
        text-align: right !important;
        margin-top: 0.2rem !important;
    }
    
    #guestJobRequestModal #guest-char-counter.text-success {
        color: #51cf66 !important;
    }
    
    #guestJobRequestModal #guest-char-counter.text-danger {
        color: #ff6b6b !important;
    }
}

/* Ensure modal shows above all other content */
#guestJobRequestModal {
    z-index: 1060;
}

#guestJobRequestModal .modal-backdrop {
    z-index: 1040;
}

/* Force cleanup of modal artifacts */
.modal-backdrop.fade {
    transition: opacity 0.15s linear;
}

/* Ensure no lingering modal styles */
body.modal-cleanup {
    overflow: auto !important;
    padding-right: 0 !important;
}