/* ===== Scoped CSS for Capybara Job Form ===== */
.capybara-job-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.capybara-job-wrapper .cpay-job-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1f2e;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

.capybara-job-wrapper .cpay-job-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 20%, rgba(139, 195, 74, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(139, 195, 74, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* ===== Main Form Container ===== */
.capybara-job-wrapper .job-form-container {
    background: rgba(45, 55, 72, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(139, 195, 74, 0.1);
    border: 1px solid rgba(139, 195, 74, 0.15);
    max-width: 1000px;
    width: 100%;
    padding: 40px;
    position: relative;
    z-index: 1;
}

/* Form Header */
.capybara-job-wrapper .form-header {
    text-align: center;
    margin-bottom: 40px;
}

.capybara-job-wrapper .company-logo {
    font-size: 2.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #8bc34a, #7cb342);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(139, 195, 74, 0.3);
    margin-bottom: 25px;
    line-height: 1.2;
}

.capybara-job-wrapper .form-title {
    color: #ffffff;
    font-size: 2em;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    line-height: 1.2;
}

.capybara-job-wrapper .form-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1em;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Form Grid */
.capybara-job-wrapper .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.capybara-job-wrapper .form-group.full-width {
    grid-column: 1 / -1;
}

.capybara-job-wrapper label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95em;
}

.capybara-job-wrapper input,
.capybara-job-wrapper select,
.capybara-job-wrapper textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(139, 195, 74, 0.2);
    border-radius: 16px;
    font-size: 1em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(26, 31, 46, 0.8);
    color: #ffffff;
    backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.03);
}

.capybara-job-wrapper input::placeholder,
.capybara-job-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.capybara-job-wrapper input:focus,
.capybara-job-wrapper select:focus,
.capybara-job-wrapper textarea:focus {
    outline: none;
    border-color: #8bc34a;
    box-shadow: 
        0 0 0 4px rgba(139, 195, 74, 0.15),
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(139, 195, 74, 0.2);
    transform: translateY(-2px);
    background: rgba(26, 31, 46, 0.95);
}

.capybara-job-wrapper select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238bc34a' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.capybara-job-wrapper textarea {
    resize: vertical;
    min-height: 120px;
}

/* Submit Button */
.capybara-job-wrapper .submit-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 18px 40px;
    font-size: 1.1em;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.12) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    margin-top: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .capybara-job-wrapper .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* ===== CHOICES.JS MULTI-SELECT DARK THEME ===== */

/* Main container */
.capybara-job-wrapper .choices {
    margin-bottom: 0 !important;
    font-size: 1em !important;
}

/* Inner box (where selected items appear) */
.capybara-job-wrapper .choices__inner,
.capybara-job-wrapper .choices[data-type*="select-multiple"] .choices__inner,
.capybara-job-wrapper .choices[data-type*="select-one"] .choices__inner {
    background-color: rgba(26, 31, 46, 0.8) !important;
    border-radius: 16px !important;
    border: 2px solid rgba(139, 195, 74, 0.2) !important;
    color: #ffffff !important;
    min-height: 50px !important;
    padding: 8px 12px !important;
    font-size: 1em !important;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

/* Focused state */
.capybara-job-wrapper .choices.is-focused .choices__inner,
.capybara-job-wrapper .choices.is-open .choices__inner {
    border-color: #8bc34a !important;
    box-shadow: 
        0 0 0 4px rgba(139, 195, 74, 0.15),
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(139, 195, 74, 0.2) !important;
    transform: translateY(-2px);
    background: rgba(26, 31, 46, 0.95) !important;
}

/* List of selected items */
.capybara-job-wrapper .choices__list--multiple {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
}

/* Individual selected item (pill) */
.capybara-job-wrapper .choices__list--multiple .choices__item {
    background-color: #8bc34a !important;
    color: #1a1f2e !important;
    border-radius: 12px !important;
    padding: 6px 10px !important;
    font-weight: 600 !important;
    font-size: 0.9em !important;
    margin: 0 !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* Remove button on selected items */
.capybara-job-wrapper .choices__list--multiple .choices__item .choices__button {
    background: none !important;
    border: none !important;
    color: #1a1f2e !important;
    font-size: 1.2em !important;
    padding: 0 !important;
    margin-left: 4px !important;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s;
}

.capybara-job-wrapper .choices__list--multiple .choices__item .choices__button:hover {
    opacity: 1;
}

/* Placeholder text and search input in main box */
.capybara-job-wrapper .choices__input {
    background-color: transparent !important;
    color: #ffffff !important;
    font-size: 1em !important;
    padding: 4px 0 !important;
    margin: 4px 0 0 0 !important;
    flex: 1 !important;
    min-width: 150px !important;
}

.capybara-job-wrapper .choices__input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Dropdown arrow */
.capybara-job-wrapper .choices::after {
    border-color: #8bc34a transparent transparent transparent !important;
    margin-top: -2px;
}

.capybara-job-wrapper .choices.is-open::after {
    border-color: transparent transparent #8bc34a transparent !important;
    margin-top: -7px;
}

/* Dropdown menu */
.capybara-job-wrapper .choices__list--dropdown,
.capybara-job-wrapper .choices__list[aria-expanded] {
    background-color: rgba(26, 31, 46, 0.98) !important;
    border-radius: 16px !important;
    border: 2px solid rgba(139, 195, 74, 0.2) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    color: #ffffff !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    margin-top: 8px !important;
    padding: 8px !important;
    z-index: 9999 !important;
    backdrop-filter: blur(15px) !important;
}

/* Dropdown options */
.capybara-job-wrapper .choices__list--dropdown .choices__item,
.capybara-job-wrapper .choices__list[aria-expanded] .choices__item,
.capybara-job-wrapper .choices__list--dropdown .choices__item--choice {
    background-color: transparent !important;
    padding: 12px 16px !important;
    font-size: 1em !important;
    color: #ffffff !important;
    cursor: pointer !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
    margin-bottom: 4px !important;
}

/* Highlighted/hovered option */
.capybara-job-wrapper .choices__list--dropdown .choices__item--selectable.is-highlighted,
.capybara-job-wrapper .choices__list[aria-expanded] .choices__item--selectable.is-highlighted,
.capybara-job-wrapper .choices__list--dropdown .choices__item.is-highlighted {
    background-color: #8bc34a !important;
    color: #1a1f2e !important;
}

/* Selected option in dropdown */
.capybara-job-wrapper .choices__list--dropdown .choices__item--selected {
    opacity: 0.5;
}

/* Search input inside dropdown */
.capybara-job-wrapper .choices__list--dropdown .choices__input,
.capybara-job-wrapper .choices__input--cloned {
    background-color: rgba(26, 31, 46, 0.6) !important;
    color: #ffffff !important;
    font-size: 1em !important;
    padding: 10px 16px !important;
    margin: 0 0 8px 0 !important;
    border: 2px solid rgba(139, 195, 74, 0.2) !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.capybara-job-wrapper .choices__list--dropdown .choices__input::placeholder,
.capybara-job-wrapper .choices__input--cloned::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.capybara-job-wrapper .choices__list--dropdown .choices__input:focus,
.capybara-job-wrapper .choices__input--cloned:focus {
    outline: none !important;
    border-color: #8bc34a !important;
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.15) !important;
}

/* Scrollbar styling for dropdown */
.capybara-job-wrapper .choices__list--dropdown::-webkit-scrollbar {
    width: 8px;
}

.capybara-job-wrapper .choices__list--dropdown::-webkit-scrollbar-track {
    background: rgba(26, 31, 46, 0.5);
    border-radius: 8px;
}

.capybara-job-wrapper .choices__list--dropdown::-webkit-scrollbar-thumb {
    background: rgba(139, 195, 74, 0.5);
    border-radius: 8px;
}

.capybara-job-wrapper .choices__list--dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 195, 74, 0.7);
}

/* Disabled state */
.capybara-job-wrapper .choices.is-disabled .choices__inner {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== ADDITIONAL FIXES FOR DROPDOWN ===== */

/* Force dark background on all dropdown states */
.capybara-job-wrapper .choices.is-open .choices__list--dropdown,
.capybara-job-wrapper .choices.is-open .choices__list[role="listbox"],
.capybara-job-wrapper div[data-type="select-multiple"].is-open .choices__list--dropdown,
.capybara-job-wrapper .choices__list[role="listbox"] {
    background: rgba(26, 31, 46, 0.98) !important;
    background-color: rgba(26, 31, 46, 0.98) !important;
}

/* Override default white background */
.capybara-job-wrapper .choices__list.choices__list--dropdown {
    background: rgba(26, 31, 46, 0.98) !important;
}

/* Fix for dropdown appearing outside wrapper */
.choices__list--dropdown {
    background: rgba(26, 31, 46, 0.98) !important;
    border: 2px solid rgba(139, 195, 74, 0.2) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.choices__list--dropdown .choices__item {
    color: #ffffff !important;
}

.choices__list--dropdown .choices__item.is-highlighted {
    background: #8bc34a !important;
    color: #1a1f2e !important;
}


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

.capybara-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.capybara-modal.show {
    opacity: 1;
}

.capybara-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.capybara-modal-content {
    position: relative;
    background: linear-gradient(145deg, rgba(26, 31, 46, 0.98), rgba(30, 35, 48, 0.98));
    padding: 40px;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(139, 195, 74, 0.2);
    border: 1px solid rgba(139, 195, 74, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100000;
}

.capybara-modal.show .capybara-modal-content {
    transform: scale(1);
}

.capybara-modal-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.capybara-modal-title {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
}

.capybara-modal-message {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 10px;
}

.capybara-modal-resume {
    margin-top: 15px;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.file-preview-box {
    position: relative;
    margin-top: 15px;
    background: rgba(30, 35, 45, 0.8);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid rgba(139, 195, 74, 0.2);
}

.delete-file-btn {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8bc34a, #7cb342);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.delete-file-btn:hover {
    transform: scale(1.1);
}

.file-preview-box span:first-of-type {
    font-size: 28px;
}

.file-preview-box span:last-of-type {
    color: #fff;
    font-weight: 500;
    word-break: break-word;
    flex: 1;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 195, 74, 0.1);
    border: 1px solid rgba(139, 195, 74, 0.3);
    padding: 8px 16px;
    border-radius: 50px;
    color: #8bc34a;
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 15px;
}

.required {
    color: #f44336;
}

.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: block;
    padding: 14px 18px;
    border: 2px dashed rgba(139, 195, 74, 0.3);
    border-radius: 16px;
    background: rgba(26, 31, 46, 0.5);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    border-color: #8bc34a;
    background: rgba(26, 31, 46, 0.8);
    color: #8bc34a;
}

/* Loading state for submit button */
.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* File preview box styling */
.file-preview-box {
    position: relative;
    margin-top: 15px;
    background: rgba(30, 35, 45, 0.8);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid rgba(139, 195, 74, 0.2);
}

.delete-file-btn {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8bc34a, #7cb342);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.delete-file-btn:hover {
    transform: scale(1.1);
}

.file-preview-box span:first-of-type {
    font-size: 28px;
}

.file-preview-box span:last-of-type {
    color: #fff;
    font-weight: 500;
    word-break: break-word;
    flex: 1;
}

/* AI Badge Styling (if not already present) */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 195, 74, 0.1);
    border: 1px solid rgba(139, 195, 74, 0.3);
    padding: 8px 16px;
    border-radius: 50px;
    color: #8bc34a;
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 15px;
}

.required {
    color: #f44336;
}

/* File upload label */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: block;
    padding: 14px 18px;
    border: 2px dashed rgba(139, 195, 74, 0.3);
    border-radius: 16px;
    background: rgba(26, 31, 46, 0.5);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    border-color: #8bc34a;
    background: rgba(26, 31, 46, 0.8);
    color: #8bc34a;
}