/* CSS Variables */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* Navbar */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.nav-logo:hover {
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--gray-600);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--gray-100);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    transition: all 0.3s;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

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

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

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

.btn-block {
    width: 100%;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 1rem;
}

/* Messages */
.messages {
    max-width: 1200px;
    margin: 0 auto 1rem;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
}

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    margin: -2rem -1rem 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-search {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-search .search-input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta .btn-outline {
    border-color: var(--white);
    color: var(--white);
}

.hero-cta .btn-outline:hover {
    background: var(--white);
    color: var(--primary);
}

/* Features */
.features {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--gray-500);
}

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

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

.auth-card h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--gray-500);
}

.auth-footer a {
    display: block;
    margin-top: 0.5rem;
}

.divider {
    display: block;
    margin: 0.5rem 0;
    color: var(--gray-400);
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.help-text {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.error {
    font-size: 0.75rem;
    color: var(--danger);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

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

.dashboard-header h1 {
    font-size: 1.75rem;
}

.user-role {
    color: var(--gray-500);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

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

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

.stat-label {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.dashboard-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
}

/* Job Grid */
.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

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

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

.job-card h3 {
    font-size: 1rem;
    margin: 0;
}

.match-badge {
    background: var(--secondary);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.company-name {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.job-location {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.tag {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

/* Job List */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

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

.search-filters {
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    min-width: 150px;
}

.job-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.job-list-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.job-list-main {
    flex: 1;
}

.job-list-main h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.job-list-main h3 a {
    color: var(--gray-900);
}

.job-list-main h3 a:hover {
    color: var(--primary);
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

/* Job Detail */
.job-detail {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.job-detail-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.job-detail-title h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.job-detail-title .company-name {
    color: rgba(255, 255, 255, 0.9);
}

.application-status {
    text-align: right;
}

.job-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
}

.meta-icon {
    font-size: 1.25rem;
}

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

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

.job-detail-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.job-description {
    color: var(--gray-600);
    line-height: 1.8;
}

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

.application-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.application-main h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.applied-date {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.application-status-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.ats-score {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Status */
.status {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-pending {
    background: var(--gray-100);
    color: var(--gray-700);
}

.status-reviewed {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-shortlisted {
    background: #FEF3C7;
    color: #92400E;
}

.status-accepted {
    background: #D1FAE5;
    color: #065F46;
}

.status-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

.status-active {
    background: #D1FAE5;
    color: #065F46;
}

.status-inactive {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Tables */
.jobs-table-container {
    overflow-x: auto;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.jobs-table th,
.jobs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.jobs-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.jobs-table td small {
    display: block;
    color: var(--gray-500);
    font-size: 0.75rem;
}

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

.badge {
    background: var(--primary-light);
    color: var(--white);
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Sort Options */
.sort-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.sort-options a {
    color: var(--gray-600);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
}

.sort-options a:hover,
.sort-options a.active {
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
}

/* Applications Grid */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.applicant-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.applicant-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.applicant-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

.applicant-avatar.large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.applicant-info {
    flex: 1;
}

.applicant-info h3 {
    font-size: 1rem;
    margin-bottom: 0.125rem;
}

.applicant-info p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.ats-badge {
    text-align: center;
}

.ats-badge .score {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.ats-badge .label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.applicant-details {
    padding: 1rem 1.25rem;
}

.applicant-details p {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.resume-link {
    display: block;
    padding: 0.75rem 1.25rem;
    background: var(--gray-50);
    font-size: 0.875rem;
}

.applicant-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.applicant-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.status-form {
    flex: 1;
}

.status-form select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
}

/* Applicant Detail */
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--gray-600);
}

.applicant-detail {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.applicant-detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.applicant-detail-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.applicant-detail-info p {
    color: var(--gray-500);
}

.ats-score-large {
    margin-left: auto;
    text-align: center;
    padding: 1rem 2rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.ats-score-large .score {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.ats-score-large .label {
    color: var(--gray-500);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2rem;
}

.detail-section h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--gray-600);
}

.detail-section dl {
    display: grid;
    gap: 0.75rem;
}

.detail-section dt {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.detail-section dd {
    font-size: 1rem;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
}

.status-select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
}

/* Profile */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--white);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.profile-avatar.company {
    background: var(--secondary);
    color: var(--white);
}

.profile-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.profile-info p {
    opacity: 0.9;
}

.profile-form {
    padding: 2rem;
}

.current-resume {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

/* Form Container */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.form-container h1 {
    margin-bottom: 2rem;
}

/* Apply Container */
.apply-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.apply-header {
    padding: 1.5rem 2rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.apply-header h1 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.apply-header p {
    color: var(--gray-500);
}

.apply-info {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.apply-info h3 {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.apply-info p {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.apply-info .warning {
    color: var(--warning);
}

.apply-form {
    padding: 2rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.empty-state h2 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state .btn {
    margin-top: 1rem;
}

/* Footer */
.footer {
    background: var(--gray-800);
    color: var(--gray-400);
    padding: 2rem 1rem;
    text-align: center;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-search {
        flex-direction: column;
    }

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

    .job-list-item {
        flex-direction: column;
    }

    .job-list-action {
        width: 100%;
    }

    .job-list-action .btn {
        width: 100%;
    }

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

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

    .applicant-detail-header {
        flex-direction: column;
        text-align: center;
    }

    .ats-score-large {
        margin-left: 0;
    }

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