/* Main Container */
.ai-scanner-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    padding: 20px;
    border-radius: 12px;
}

/* Left Column: Form Card */
.ai-form-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.ai-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    display: block;
}

.ai-input-group {
    margin-bottom: 1.5rem;
}

.ai-form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #334155;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
input.ai-form-control[list] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem !important; /* Space for the arrow */
    cursor: pointer;
}
input[list]::-webkit-calendar-picker-indicator {
    opacity: 0; /* Make native arrow invisible but clickable over our custom arrow */
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3rem;
    height: 100%;
    cursor: pointer;
}
.ai-form-control:focus {
    border-color: #8b5cf6;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ai-btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    width: 100%;
    transition: opacity 0.2s;
}

.ai-btn-primary:hover {
    opacity: 0.9;
    color: white;
}

.ai-btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Right Column: Empty State */
.ai-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    background-color: #f8fafc;
    text-align: center;
    color: #94a3b8;
}

.ai-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Result Cards */
.ai-job-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #8b5cf6;
}

.ai-job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.ai-job-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-salary-badge {
    background-color: #dcfce7;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 9999px;
    white-space: nowrap;
}

.ai-job-desc {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.ai-match-reason {
    background-color: #f1f5f9;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 12px;
    font-style: italic;
}

.ai-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-tag {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Loading Spinner */
.ai-loader {
    display: none;
    text-align: center;
    padding: 40px;
}
.spinner-border {
    width: 3rem; 
    height: 3rem; 
    color: #8b5cf6;
}

/* --- Saved Area Styles (New) --- */
.ai-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ai-saved-area {
    display: none; /* Hidden by default */
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.saved-scan-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    position: relative;
    background: #fff;
}

.saved-scan-card:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.saved-scan-card:active {
    transform: scale(0.98);
}

/* Save Button Positioning */
.ai-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.btn-toggle-saved {
    background: royalblue;
    border: 1px solid #cbd5e1;
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-toggle-saved:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Cross Promotion Card  */
.ai-promo-card {
    background: #f8fafc;  
    border: 2px dashed #6366f1;  
    border-radius: 12px;
    margin-top: 30px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ai-promo-title {
    color: #1e293b;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.ai-promo-subtitle {
    color: #ef4444; /* Red for the "Warning" hook */
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 15px;
    display: block;
}

.ai-promo-usps {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ai-promo-tag {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-promo-action {
    background-color: #4f46e5; /* Primary Brand Color */
    color: #ffffff !important;
    font-weight: 700;
    padding: 10px 30px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    transition: all 0.2s;
}

.btn-promo-action:hover {
    background-color: #4338ca;
    color: #fafafa !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
}

/* Rate Limit Modal */
.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.ai-modal-card {
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: ai-modal-pop 0.3s ease-out;
}

.ai-modal-icon {
    width: 60px;
    height: 60px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 20px;
}

.ai-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
}

.ai-modal-body {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

.btn-modal-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white!important;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    text-decoration: none;
    display: block;
    transition: opacity 0.2s;
}

.btn-modal-primary:hover { opacity: 0.9; color: #fafafa!important; }

@keyframes ai-modal-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Modal Close (X) Button */
.ai-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 5px;
    line-height: 1;
    z-index: 10;
}

.ai-modal-close:hover {
    color: #ef4444; /* Red on hover */
    transform: scale(1.1);
}