/* DigitalMe Discover Page Styles
 * Search form, results cards, browse grid.
 */

/* === Header === */
.discover-header {
    margin-bottom: 24px;
}

.discover-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.discover-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* === Info Banner === */
.info-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 0.88rem;
    color: #1e40af;
}

.info-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* === Search Section === */
.search-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
}

.search-section h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.search-section textarea {
    width: 100%;
    min-height: 160px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.15s;
}

.search-section textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.search-options {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 16px 0;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-group label {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
}

.option-group input[type="range"] {
    width: 120px;
    accent-color: var(--primary);
}

.option-group select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.search-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.search-btn:hover {
    opacity: 0.9;
}

/* === Loading Indicator === */
.loading-indicator {
    display: none;
    text-align: center;
    padding: 24px;
    color: var(--text-light);
}

.loading-indicator.htmx-request {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === Search Error === */
.search-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Results Section === */
.results-section {
    margin-top: 24px;
}

.results-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.results-header h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.results-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* === Candidate Card === */
.candidate-card {
    display: flex;
    gap: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
}

.score-badge {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.score-badge.high {
    background: #d1fae5;
    color: #065f46;
}

.score-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.score-badge.low {
    background: #fee2e2;
    color: #991b1b;
}

.score-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.candidate-info {
    flex: 1;
    min-width: 0;
}

.candidate-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
}

.candidate-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.candidate-tagline {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 2px;
}

.candidate-summary {
    font-size: 0.9rem;
    color: var(--text-medium, #4b5563);
    margin: 10px 0;
    line-height: 1.5;
}

/* === Skills List === */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.skill-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

.discipline-warning {
    display: inline-block;
    padding: 3px 10px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

.domain-warning {
    display: inline-block;
    padding: 3px 10px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* === Skill Breakdown (details/summary) === */
.match-detail {
    margin-bottom: 12px;
}

.match-detail-toggle {
    cursor: pointer;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 0;
    list-style: none;
}

.match-detail-toggle::-webkit-details-marker {
    display: none;
}

.match-detail-toggle::before {
    content: '▶ ';
    font-size: 0.7rem;
}

.match-detail[open] .match-detail-toggle::before {
    content: '▼ ';
}

.match-detail-content {
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-light, #f9fafb);
    border-radius: 8px;
}

.skill-matches-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.skill-match-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

.skill-match-chip.strong {
    background: #d1fae5;
    color: #065f46;
}

.skill-match-chip.partial {
    background: #fef3c7;
    color: #92400e;
}

.skill-match-chip.none {
    background: #fee2e2;
    color: #991b1b;
}

.match-section {
    margin-top: 10px;
}

.match-section strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.match-section ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.85rem;
    color: var(--text-medium, #4b5563);
}

.match-section ul li {
    padding: 2px 0;
}

/* === Candidate Actions === */
.candidate-actions {
    display: flex;
    gap: 8px;
}

.btn-view {
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text-dark);
}

.btn-view:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-chat {
    background: var(--primary);
    color: white;
}

.btn-chat:hover {
    background: var(--primary-dark);
    color: white;
}

/* === No Results === */
.no-results {
    text-align: center;
    padding: 48px 24px;
    margin-top: 16px;
    color: var(--text-light);
}

/* === Browse Section === */
.browse-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.browse-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.browse-header h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.browse-count {
    font-size: 0.85rem;
    color: var(--text-light);
}

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

.browse-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.browse-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    text-decoration: none;
}

.browse-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.browse-tagline {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.browse-stats {
    font-size: 0.82rem;
    color: var(--text-light);
}

/* === Browse Auth Prompt === */
.browse-auth-prompt {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-light);
}

.auth-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
}

.browse-auth-prompt p {
    margin-bottom: 16px;
}

/* === Responsive === */
@media (max-width: 640px) {
    .candidate-card {
        flex-direction: column;
    }

    .score-badge {
        width: auto;
        height: auto;
        flex-direction: row;
        gap: 6px;
        padding: 6px 12px;
    }

    .search-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .candidate-actions {
        flex-direction: column;
    }

    .candidate-actions .btn-sm {
        text-align: center;
    }
}
