/* Recruitment Management System - Main Stylesheet */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #334155;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    background: white;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

/* Job Cards */
.job-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.job-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.job-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.job-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.badge-open {
    background: #d1fae5;
    color: #065f46;
}

.badge-closed {
    background: #fee2e2;
    color: #991b1b;
}

/* ========== DataTables – uniform table UI ========== */
.table-card .card-body {
    padding: 0;
    overflow: hidden;
}

.table-card .dataTables_wrapper,
.card-body > .dataTables_wrapper {
    padding: 1.25rem 1.5rem;
}

/* Toolbar row: length + search + buttons */
.dataTables_wrapper .dt-toolbar {
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}

.dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}
.dataTables_wrapper .dt-export-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    margin-right: 0.25rem;
}
.dataTables_wrapper .dt-buttons .btn-export {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: #475569;
    transition: border-color .2s, background .2s, color .2s;
}
.dataTables_wrapper .dt-buttons .btn-export:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
    color: var(--primary-color);
}
.dataTables_wrapper .dt-buttons .btn-export-pdf:hover {
    border-color: #dc2626;
    background: #fef2f2;
    color: #dc2626;
}
.dataTables_wrapper .dt-buttons .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.dataTables_length label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-weight: 500;
    color: var(--dark-color);
}

.dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    font-size: 0.9rem;
    background: #fff;
    min-width: 4.5rem;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    margin: 0;
    font-weight: 500;
    color: var(--dark-color);
}
.dataTables_filter label::before {
    content: 'Search:';
    margin-right: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}
.dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem 0.5rem 0.75rem;
    margin-left: 0;
    font-size: 0.9rem;
    min-width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dataTables_filter input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Table */
table.dataTable {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 0 1rem 0;
}

table.dataTable thead th {
    background: var(--dark-color);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.85rem 1rem;
    border: none;
    white-space: nowrap;
}

table.dataTable thead th:first-child {
    border-radius: 10px 0 0 0;
}

table.dataTable thead th:last-child {
    border-radius: 0 10px 0 0;
}

/* Sortable columns: click to sort, arrows shown */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    cursor: pointer;
    padding-right: 1.75rem;
    position: relative;
}
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    opacity: 0.7;
}
table.dataTable thead th.sorting::after {
    content: '\21C5';
}
table.dataTable thead th.sorting_asc::after {
    content: '\2191';
    opacity: 1;
}
table.dataTable thead th.sorting_desc::after {
    content: '\2193';
    opacity: 1;
}

table.dataTable tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

table.dataTable tbody tr {
    transition: background 0.15s ease;
}

table.dataTable tbody tr:hover {
    background: #f0f9ff;
}

table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

table.dataTable tbody tr.even {
    background: #fafbfc;
}

table.dataTable tbody tr.even:hover {
    background: #f0f9ff;
}

table.dataTable tbody td .badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Footer: info + pagination */
.dataTables_wrapper .dt-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dataTables_info {
    font-size: 0.875rem;
    color: #64748b;
    padding: 0;
}

.dataTables_paginate {
    margin: 0;
    padding: 0;
}

.dataTables_paginate .paginate_button {
    padding: 0.4rem 0.75rem !important;
    margin: 0 2px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    background: #fff !important;
    color: var(--dark-color) !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
}

.dataTables_paginate .paginate_button:hover {
    background: #f1f5f9 !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive table wrapper */
.dataTables_wrapper .dataTables_scroll {
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

/* Non-DataTable tables in cards (uniform look) */
.table-card .table:not(.dataTable),
.card-body > .table:not(.dataTable) {
    margin: 0;
}

.table-card .table:not(.dataTable) thead th,
.card .card-body .table thead th {
    background: var(--dark-color);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.85rem 1rem;
    border: none;
}

.table-card .table:not(.dataTable) tbody td,
.card .card-body .table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.table-card .table:not(.dataTable) tbody tr:hover,
.card .card-body .table tbody tr:hover {
    background: #f0f9ff;
}

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.filter-item {
    flex: 1;
    min-width: 200px;
}

.filter-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.filter-item select,
.filter-item input {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.filter-item select:focus,
.filter-item input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.stats-card.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.stats-card.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.stats-card.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.stats-card p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

/* Forms */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

/* Modal */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* Page Header */
.page-header {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.page-header h1 {
    color: var(--dark-color);
    font-weight: 700;
    margin: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Payment Gate */
.payment-gate {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 3rem auto;
}

.payment-gate i {
    font-size: 4rem;
    color: var(--warning-color);
    margin-bottom: 1.5rem;
}

.payment-gate h2 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

/* Job Details */
.job-details {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.job-details-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.job-details-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-group {
        flex-direction: column;
    }
    
    .filter-item {
        width: 100%;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .navbar,
    .btn,
    .filters-section {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}
