/* =====================================================================
 * DailyJob – homepage additions (search results, popup close, suggestions)
 * Location: dailyjob.in/style/home.css
 * Load AFTER style.css. Uses the colour variables defined in style.css.
 * ===================================================================== */

/* Autocomplete: second line (Hindi name · category) */
.suggestion-item small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--secondary-color);
    margin-top: 2px;
}

/* Search results */
.search-results {
    padding: 60px 0 20px;
    animation: fadeIn 0.6s ease-out;
}

.search-results h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.results-count {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

.results-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.result-card {
    background-color: white;
    padding: 22px 20px;
    border-radius: 8px;
    border: 1px solid var(--gray-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.result-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--dark-color);
}

.result-card h3 i {
    color: var(--primary-color);
    margin-right: 4px;
}

.result-meta {
    color: var(--secondary-color);
    font-size: 15px;
    margin-bottom: 12px;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.result-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.08);
}

.result-wage {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.result-wage span {
    font-size: 15px;
    font-weight: 500;
    color: var(--secondary-color);
}

.result-line {
    font-size: 15px;
    color: #374151;
    margin-bottom: 6px;
}

.result-line:last-child {
    margin-bottom: 0;
}

.result-line i {
    width: 18px;
    color: var(--primary-color);
    margin-right: 4px;
}

/* Messages */
.result-alert {
    max-width: 700px;
    margin: 0 auto 20px;
    padding: 14px 20px;
    border-radius: 8px;
    text-align: center;
    background-color: white;
    border: 1px solid var(--gray-light);
    color: #374151;
}

.result-alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.result-alert-warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* Login popup close button */
.popup-close {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 1;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    transition: var(--transition);
}

.popup-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .search-results {
        padding: 40px 0 10px;
    }

    .search-results h2 {
        font-size: 26px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
 * Login popup (Mobile/Email + Continue, then password or email OTP)
 * Builds on .login-popup, .popup-content, .popup-header, .popup-form and
 * .form-group from style.css.
 * ===================================================================== */
.login-popup .popup-content {
    max-height: 92vh;
    overflow-y: auto;
}

/* Elements switched off by the script (hidden attribute) stay hidden even if a class sets display */
.login-popup [hidden] {
    display: none !important;
}

.auth-alert {
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 0.92rem;
    text-align: left;
}

.auth-alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-alert-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.auth-alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Account found: who is logging in */
.auth-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    background-color: var(--light-color);
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    text-align: left;
    word-break: break-all;
}

.auth-identity i {
    color: var(--primary-color);
    font-size: 20px;
}

.auth-identity strong {
    flex: 1;
}

.auth-identity .auth-link {
    flex-shrink: 0;
    word-break: normal;
}

/* "or" line between password and OTP */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--gray-light);
}

.auth-otp-btn {
    width: 100%;
    word-break: break-all;
}

.auth-panel .auth-submit {
    width: 100%;
    margin-top: 4px;
}

.auth-panel .auth-submit:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.auth-note {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 16px;
    text-align: left;
}

.auth-panel .auth-submit + .auth-note {
    margin: 14px 0 0;
    text-align: center;
}

.auth-switch {
    margin: 14px 0 0;
    font-size: 0.9rem;
    text-align: center;
    color: var(--secondary-color);
}

.auth-switch a,
.auth-link {
    color: var(--primary-color);
    font-weight: 500;
}

.auth-link {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    cursor: pointer;
}

.auth-link:hover:not(:disabled),
.auth-switch a:hover {
    text-decoration: underline;
}

.auth-link:disabled {
    color: var(--secondary-color);
    cursor: default;
}

.auth-switch span {
    margin: 0 6px;
}

.form-group .auth-code-input {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 10px;
    text-align: center;
}

.auth-terms-note {
    margin: 12px 0 0;
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-align: center;
}

.auth-terms-note a {
    color: var(--primary-color);
    text-decoration: underline;
}

@media (max-width: 576px) {
    .login-popup .popup-header {
        padding: 20px 40px 18px;
    }
}
