/* ============================================================
   SHARED JOB APPLICATION MODAL STYLES
   Include on every job page with:
   <link rel="stylesheet" href="../css/job-modal.css">
   ============================================================ */

/* Trigger button */
.apply-cta {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.apply-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 80px rgba(0,0,0,0.15);
}

/* Bottom CTA */
.bottom-cta {
    text-align: center;
    padding: 4rem 2rem;
}

.bottom-cta .apply-cta {
    display: inline-block;
    width: auto;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    margin-top: 0;
}

/* ===== Modal Overlay ===== */
.job-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.job-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* ===== Modal Box ===== */
.job-modal {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin: auto;
}

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

/* Close button */
.job-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.job-modal-close:hover {
    background: rgba(255, 107, 53, 0.1);
    color: #FF6B35;
    transform: rotate(90deg);
}

/* Modal header */
.job-modal-header {
    padding: 2.5rem 2.5rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #1A1A1A 0%, #2C2C2C 100%);
    border-radius: 20px 20px 0 0;
    color: white;
}

.job-modal-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.job-modal-role {
    display: inline-block;
    font-size: 0.9rem;
    color: #D4AF37;
    font-weight: 600;
    padding: 0.3rem 0.9rem;
    background: rgba(212, 175, 55, 0.12);
    border-radius: 30px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* Modal body */
.job-modal-body {
    padding: 2rem 2.5rem 2.5rem;
}

/* Form groups */
.job-form-group {
    margin-bottom: 1.25rem;
}

.job-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2C2C2C;
    font-weight: 500;
    font-size: 0.9rem;
}

.job-form-group label .required {
    color: #FF6B35;
}

.job-form-group input,
.job-form-group select,
.job-form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #F8F9FA;
    color: #2C2C2C;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.job-form-group input:focus,
.job-form-group select:focus,
.job-form-group textarea:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    background: white;
}

.job-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.job-form-hint {
    display: block;
    color: #999;
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

/* Submit button */
.job-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    font-family: inherit;
}

.job-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

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

/* Success state */
.job-success-state {
    text-align: center;
    padding: 3rem 2.5rem;
    display: none;
}

.job-success-state.active {
    display: block;
}

.job-success-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: white;
    margin: 0 auto 1.5rem;
    animation: successPop 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.job-success-state h3 {
    font-size: 1.75rem;
    color: #2C2C2C;
    margin-bottom: 0.75rem;
}

.job-success-state p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.job-success-state .job-modal-role {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.job-success-close {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: white;
    padding: 0.85rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.job-success-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

/* Error message */
.job-error-msg {
    display: none;
    background: #f8d7da;
    color: #721c24;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
    font-size: 0.9rem;
}

.job-error-msg.active {
    display: block;
}

/* Loading spinner */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile */
@media (max-width: 768px) {
    .job-modal-overlay {
        padding: 1rem 0.5rem;
        align-items: flex-start;
    }

    .job-modal {
        max-height: calc(100vh - 2rem);
        border-radius: 16px;
    }

    .job-modal-header {
        padding: 2rem 1.5rem 1rem;
        border-radius: 16px 16px 0 0;
    }

    .job-modal-header h2 {
        font-size: 1.3rem;
        padding-right: 2rem;
    }

    .job-modal-body {
        padding: 1.5rem 1.5rem 2rem;
    }

    .job-form-row {
        grid-template-columns: 1fr;
    }

    .job-success-state {
        padding: 2rem 1.5rem;
    }

    .job-success-state h3 {
        font-size: 1.4rem;
    }
}