/**
 * ATS Frontend Styles
 * 
 * Comprehensive styling for the ATS frontend:
 * - Job listings
 * - Application forms
 * - Dashboards
 * - Modals
 * - Responsive design
 */

/* ========================================
   Variables & Reset
   ======================================== */
:root {
    --ats-primary: #3498db;
    --ats-secondary: #2c3e50;
    --ats-success: #27ae60;
    --ats-warning: #f39c12;
    --ats-danger: #e74c3c;
    --ats-info: #3498db;
    --ats-light: #ecf0f1;
    --ats-dark: #2c3e50;
    --ats-border: #dfe6e9;
    --ats-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --ats-radius: 8px;
    --ats-transition: all 0.3s ease;
}

.ats-job-listings *,
.ats-application-form-wrapper *,
.ats-candidate-dashboard *,
.ats-recruiter-dashboard *,
.ats-modal * {
    box-sizing: border-box;
}

/* ========================================
   Job Listings
   ======================================== */
.ats-job-listings {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ats-filters {
    background: #fff;
    padding: 20px;
    border-radius: var(--ats-radius);
    box-shadow: var(--ats-shadow);
    margin-bottom: 30px;
}

.ats-filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.ats-filter-group {
    flex: 1;
    min-width: 200px;
}

.ats-search-input,
.ats-filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    font-size: 14px;
    transition: var(--ats-transition);
}

.ats-search-input:focus,
.ats-filter-select:focus {
    outline: none;
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.ats-filter-btn {
    padding: 12px 30px;
    background: var(--ats-primary);
    color: #fff;
    border: none;
    border-radius: var(--ats-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ats-transition);
}

.ats-filter-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.ats-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.ats-job-card {
    background: #fff;
    padding: 25px;
    border-radius: var(--ats-radius);
    box-shadow: var(--ats-shadow);
    transition: var(--ats-transition);
    border: 1px solid transparent;
}

.ats-job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: var(--ats-primary);
}

.ats-job-title {
    margin: 0 0 15px;
    font-size: 20px;
    font-weight: 700;
    color: var(--ats-dark);
}

.ats-job-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--ats-transition);
}

.ats-job-title a:hover {
    color: var(--ats-primary);
}

.ats-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #7f8c8d;
}

.ats-job-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ats-job-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.ats-job-actions {
    display: flex;
    gap: 10px;
}

.ats-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--ats-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ats-transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.ats-btn-primary {
    background: var(--ats-primary);
    color: #fff;
}

.ats-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.ats-btn-secondary {
    background: var(--ats-secondary);
    color: #fff;
}

.ats-btn-secondary:hover {
    background: #1a252f;
}

.ats-no-jobs {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 16px;
}

/* ========================================
   Application Form
   ======================================== */
.ats-application-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.ats-application-form {
    background: #fff;
    padding: 30px;
    border-radius: var(--ats-radius);
    box-shadow: var(--ats-shadow);
}

.ats-form-group {
    margin-bottom: 25px;
}

.ats-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--ats-dark);
}

.ats-form-group .required {
    color: var(--ats-danger);
}

.ats-form-group input[type="file"],
.ats-form-group input[type="text"],
.ats-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--ats-transition);
}

.ats-form-group input:focus,
.ats-form-group textarea:focus {
    outline: none;
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.ats-form-help {
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
}

.ats-form-actions {
    margin-top: 30px;
}

.ats-btn-submit {
    width: 100%;
    padding: 15px;
    font-size: 16px;
}

.ats-form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--ats-radius);
    display: none;
}

.ats-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.ats-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* ========================================
   Dashboards
   ======================================== */
.ats-candidate-dashboard,
.ats-recruiter-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.ats-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.ats-dashboard-header h2 {
    margin: 0;
    color: var(--ats-dark);
}

.ats-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ats-stat-card {
    background: #fff;
    padding: 25px;
    border-radius: var(--ats-radius);
    box-shadow: var(--ats-shadow);
    text-align: center;
}

.ats-stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--ats-primary);
    margin-bottom: 10px;
}

.ats-stat-label {
    font-size: 14px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ats-applications-list {
    background: #fff;
    padding: 20px;
    border-radius: var(--ats-radius);
    box-shadow: var(--ats-shadow);
}

.ats-table {
    width: 100%;
    border-collapse: collapse;
}

.ats-table thead {
    background: var(--ats-light);
}

.ats-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--ats-dark);
    border-bottom: 2px solid var(--ats-border);
}

.ats-table td {
    padding: 15px;
    border-bottom: 1px solid var(--ats-border);
}

.ats-table tbody tr {
    transition: var(--ats-transition);
}

.ats-table tbody tr:hover {
    background: #f8f9fa;
}

.ats-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.ats-status-applied {
    background: #e3f2fd;
    color: #1976d2;
}

.ats-status-shortlisted {
    background: #fff3e0;
    color: #f57c00;
}

.ats-status-interview {
    background: #f3e5f5;
    color: #7b1fa2;
}

.ats-status-offer {
    background: #e8f5e9;
    color: #388e3c;
}

.ats-status-hired {
    background: #c8e6c9;
    color: #2e7d32;
}

.ats-status-rejected {
    background: #ffebee;
    color: #c62828;
}

.ats-status-withdrawn {
    background: #f5f5f5;
    color: #616161;
}

.ats-btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #7f8c8d;
    transition: var(--ats-transition);
    font-size: 18px;
}

.ats-btn-icon:hover {
    color: var(--ats-primary);
    transform: scale(1.2);
}

.ats-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.ats-empty-state p {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 20px;
}

/* ========================================
   Modal
   ======================================== */
.ats-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s ease;
}

.ats-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ats-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: var(--ats-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.ats-modal-large {
    max-width: 900px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ats-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: 700;
    color: #7f8c8d;
    cursor: pointer;
    transition: var(--ats-transition);
}

.ats-modal-close:hover {
    color: var(--ats-danger);
}

.ats-application-details {
    padding: 20px 0;
}

.ats-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--ats-border);
}

.ats-detail-section {
    margin-bottom: 30px;
}

.ats-detail-section h4 {
    margin-bottom: 15px;
    color: var(--ats-dark);
}

.ats-detail-table {
    width: 100%;
}

.ats-detail-table th {
    text-align: left;
    padding: 10px 15px 10px 0;
    font-weight: 600;
    color: #7f8c8d;
    width: 150px;
}

.ats-detail-table td {
    padding: 10px 0;
}

.ats-cover-letter {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--ats-radius);
    line-height: 1.8;
}

.ats-timeline {
    position: relative;
    padding-left: 30px;
}

.ats-timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.ats-timeline-marker {
    position: absolute;
    left: -30px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ats-primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--ats-primary);
}

.ats-timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 17px;
    bottom: -20px;
    width: 2px;
    background: var(--ats-border);
}

.ats-timeline-item:last-child::before {
    display: none;
}

.ats-timeline-content strong {
    display: block;
    margin-bottom: 5px;
    color: var(--ats-dark);
}

.ats-timeline-content small {
    color: #7f8c8d;
    font-size: 12px;
}

/* ========================================
   Recruiter Dashboard Specific
   ======================================== */
.ats-dashboard-filters {
    background: #fff;
    padding: 20px;
    border-radius: var(--ats-radius);
    box-shadow: var(--ats-shadow);
    margin-bottom: 20px;
}

.ats-status-select {
    padding: 8px 12px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
    font-size: 13px;
    cursor: pointer;
}

.ats-candidate-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ats-candidate-info strong {
    color: var(--ats-dark);
}

.ats-candidate-info small {
    color: #7f8c8d;
    font-size: 12px;
}

.ats-actions {
    display: flex;
    gap: 10px;
}

.ats-starred {
    background: #fffbf0 !important;
}

.ats-icon-star.starred {
    color: #f39c12;
}

.ats-bulk-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.ats-bulk-actions select {
    padding: 10px 15px;
    border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .ats-filter-form {
        flex-direction: column;
    }
    
    .ats-filter-group {
        width: 100%;
    }
    
    .ats-jobs-grid {
        grid-template-columns: 1fr;
    }
    
    .ats-dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .ats-table {
        font-size: 13px;
    }
    
    .ats-table th,
    .ats-table td {
        padding: 10px;
    }
    
    .ats-modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* ========================================
   Loading States
   ======================================== */
.ats-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.ats-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--ats-light);
    border-top-color: var(--ats-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
