/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a.btn-primary {
    color: white;
}

.nav-links a.btn-primary:hover {
    color: white;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* Header */
.header {
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-light);
}

/* Filters */
.filters {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex: 0;
    min-width: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
    background: var(--border);
}

/* Job Cards */
.job-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.job-card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.job-card:hover {
    box-shadow: var(--shadow-lg);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.job-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.job-title a {
    color: var(--text);
    text-decoration: none;
}

.job-title a:hover {
    color: var(--primary);
}

.job-meta {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-remote {
    background: #dcfce7;
    color: #166534;
}

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

.badge-onsite {
    background: #dbeafe;
    color: #1e40af;
}

.badge-visa {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Job Details */
.job-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail {
    font-size: 0.875rem;
}

.detail .label {
    color: var(--text-light);
    margin-right: 0.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Job Detail Page */
.back-link {
    margin-bottom: 1.5rem;
}

.job-detail-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.job-detail-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.job-detail-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.job-detail-info {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 0.9375rem;
}

.job-detail-contact {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.job-detail-contact h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.job-detail-contact p {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.job-detail-contact a {
    color: var(--primary);
}

.job-detail-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.job-detail-section:last-child {
    border-bottom: none;
}

.job-detail-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.raw-content {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
    font-family: inherit;
}

/* Skills Tags */
.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.job-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.skill-tag-sm {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.skill-more {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    color: var(--text-light);
    font-size: 0.75rem;
}

/* Stats Page */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-label.truncate {
    max-width: 200px;
}

.stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.stat-bar {
    grid-column: span 2;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-light);
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-block {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    margin-top: 1rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.auth-footer a {
    color: var(--primary);
}

.recruiter-link {
    margin-top: 0.75rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

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

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.page-header .subtitle {
    color: var(--text-light);
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* Upload Card */
.upload-card {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 2px dashed var(--border);
}

.upload-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.upload-form .form-group {
    flex: 1;
    min-width: 200px;
}

/* Resume List */
.resume-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resume-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.resume-filename {
    font-weight: 600;
    display: block;
}

.resume-date {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.resume-skills {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Applications List */
.applications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.application-card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.application-job h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    border: none;
    padding: 0;
}

.application-job .company {
    font-size: 0.875rem;
    color: var(--text-light);
}

.application-details {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.application-actions {
    margin-top: 1rem;
}

/* Score Circles */
.application-score {
    text-align: center;
}

.score-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.score-circle-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}

.score-high { background: #22c55e; }
.score-medium { background: #f59e0b; }
.score-low { background: #ef4444; }

.score-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Status Badges */
.badge-status-pending { background: #fef3c7; color: #92400e; }
.badge-status-screened { background: #dbeafe; color: #1e40af; }
.badge-status-shortlisted { background: #dcfce7; color: #166534; }
.badge-status-interviewed { background: #f3e8ff; color: #6b21a8; }
.badge-status-rejected { background: #fee2e2; color: #dc2626; }
.badge-status-hired { background: #22c55e; color: white; }

.badge-lg {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Match Score Large */
.match-score-large {
    text-align: center;
}

.match-score-large span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Recommendations */
.recommendation {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.recommendation-strong-match { background: #dcfce7; color: #166534; }
.recommendation-good-match { background: #dbeafe; color: #1e40af; }
.recommendation-partial-match { background: #fef3c7; color: #92400e; }
.recommendation-weak-match { background: #fee2e2; color: #dc2626; }

.recommendation-small {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Match Summary */
.match-summary {
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

/* Skills */
.skills-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.skills-section h4 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.skill-matched {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.skill-missing {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

.matched-skills-preview {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

/* Apply Section */
.apply-section {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}

.apply-form {
    max-width: 400px;
}

.apply-form .form-group {
    margin-bottom: 1rem;
}

.apply-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.apply-note {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.login-prompt, .no-resume, .already-applied {
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.login-prompt p, .no-resume p, .already-applied p {
    margin: 0;
    flex: 1;
    min-width: 200px;
}

/* Recruiter Dashboard */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-box .stat-label {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* Recruiter Job List */
.recruiter-job-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recruiter-job-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.recruiter-job-item .job-info {
    flex: 1;
}

.recruiter-job-item h4 {
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

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

.job-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.applicant-count {
    font-weight: 600;
    color: var(--primary);
}

.avg-score {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.job-actions {
    display: flex;
    gap: 0.5rem;
}

/* Applicants List */
.applicants-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.applicant-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.applicant-score {
    flex-shrink: 0;
}

.applicant-info {
    flex: 1;
}

.applicant-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.applicant-contact {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.applicant-contact a {
    color: var(--primary);
}

.resume-file {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.applicant-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.status-form select,
.status-form-inline select {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
}

.status-form-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Detail Cards */
.application-detail-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.application-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.application-detail-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.company-location, .contact-info {
    color: var(--text-light);
}

.contact-info a {
    color: var(--primary);
}

.application-detail-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.application-detail-section:last-child {
    border-bottom: none;
}

.application-detail-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    border: none;
    padding: 0;
}

/* Buttons */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* Nav User */
.nav-user {
    color: var(--text-light);
    font-size: 0.875rem;
    padding: 0 0.5rem;
}

/* Login Required Overlay for Job Details */
.login-required-section {
    position: relative;
}

.login-required-overlay {
    position: relative;
}

.blurred-preview {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
    color: var(--text-light);
    line-height: 1.8;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.login-required-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 90%;
    width: 350px;
}

.login-required-message p {
    margin-bottom: 0.5rem;
}

.login-required-message p:first-child {
    font-size: 1.125rem;
    color: var(--text);
}

.login-required-message p:nth-child(2) {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.login-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.login-buttons .btn {
    padding: 0.625rem 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .filter-buttons {
        flex-direction: row;
        width: 100%;
    }

    .filter-buttons .btn {
        flex: 1;
    }

    .job-header {
        flex-direction: column;
    }

    .job-meta {
        flex-wrap: wrap;
    }

    .job-details {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .application-header {
        flex-direction: column;
        gap: 1rem;
    }

    .application-detail-header {
        flex-direction: column;
        gap: 1rem;
    }

    .applicant-card {
        flex-direction: column;
    }

    .applicant-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .recruiter-job-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
