/**
 * Modern ATS Recruiter Dashboard
 * World-class UI/UX design with contemporary patterns
 * 
 * Features:
 * - Glassmorphism effects
 * - Smooth animations and micro-interactions
 * - Fixed header with proper z-index
 * - Sticky footer
 * - Modern gradient buttons
 * - Card-based layouts
 * - Responsive design
 */

/* ========================================
   CSS Variables & Theme
   ======================================== */
:root {
    --ats-primary: #667eea;
    --ats-primary-dark: #5568d3;
    --ats-secondary: #764ba2;
    --ats-accent: #f093fb;
    --ats-success: #10b981;
    --ats-warning: #f59e0b;
    --ats-danger: #ef4444;
    --ats-info: #3b82f6;
    
    --ats-bg-primary: #ffffff;
    --ats-bg-secondary: #f8fafc;
    --ats-bg-tertiary: #f1f5f9;
    
    --ats-text-primary: #0f172a;
    --ats-text-secondary: #475569;
    --ats-text-tertiary: #94a3b8;
    
    --ats-border: #e2e8f0;
    --ats-border-light: #f1f5f9;
    
    --ats-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ats-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ats-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ats-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --ats-radius-sm: 8px;
    --ats-radius-md: 12px;
    --ats-radius-lg: 16px;
    --ats-radius-xl: 20px;
    
    --ats-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ats-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --ats-bg-primary: #0f172a;
    --ats-bg-secondary: #1e293b;
    --ats-bg-tertiary: #334155;
    
    --ats-text-primary: #f1f5f9;
    --ats-text-secondary: #cbd5e1;
    --ats-text-tertiary: #64748b;
    
    --ats-border: #334155;
    --ats-border-light: #475569;
}

/* ========================================
   Page Layout - Fixed Header & Footer
   ======================================== */
.recruiter-dashboard-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ats-bg-secondary);
    padding-top: 80px; /* Space for fixed header */
}

.recruiter-dashboard-page .container {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    width: 100%;
}

/* Ensure footer stays at bottom */
body.page-template-page-recruiter-dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.page-template-page-recruiter-dashboard .site-footer {
    margin-top: auto;
}

/* ========================================
   HIC Wallet Widget - Modern Card
   ======================================== */
.hic-dashboard-widget {
    background: linear-gradient(135deg, var(--ats-primary) 0%, var(--ats-secondary) 100%);
    border-radius: var(--ats-radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--ats-shadow-lg);
    position: relative;
    overflow: hidden;
}

.hic-dashboard-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.hic-widget-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.hic-widget-icon {
    font-size: 40px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hic-widget-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hic-widget-label {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.hic-widget-balance {
    color: white;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hic-widget-button {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: var(--ats-radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--ats-transition);
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
    z-index: 1;
}

.hic-widget-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* ========================================
   Dashboard Header - Modern Typography
   ======================================== */
.ats-dashboard-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--ats-border);
}

.ats-dashboard-header h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--ats-text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--ats-primary) 0%, var(--ats-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ats-dashboard-header p {
    color: var(--ats-text-secondary);
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

/* ========================================
   Filters - Glassmorphism Card
   ======================================== */
.ats-dashboard-filters {
    background: var(--ats-bg-primary);
    backdrop-filter: blur(20px);
    border-radius: var(--ats-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--ats-shadow-md);
    border: 1px solid var(--ats-border);
}

.ats-filter-form {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.ats-filter-form select {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid var(--ats-border);
    border-radius: var(--ats-radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--ats-text-primary);
    background: var(--ats-bg-primary);
    transition: var(--ats-transition);
    cursor: pointer;
}

.ats-filter-form select:hover {
    border-color: var(--ats-primary);
}

.ats-filter-form select:focus {
    outline: none;
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.ats-btn-secondary {
    padding: 12px 24px;
    background: var(--ats-bg-tertiary);
    color: var(--ats-text-primary);
    border: 2px solid var(--ats-border);
    border-radius: var(--ats-radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ats-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ats-btn-secondary:hover {
    background: var(--ats-bg-primary);
    border-color: var(--ats-primary);
    color: var(--ats-primary);
    transform: translateY(-2px);
    box-shadow: var(--ats-shadow-md);
}

/* ========================================
   Applications Table - Modern Card Design
   ======================================== */
.ats-applications-table-wrapper {
    background: var(--ats-bg-primary);
    border-radius: var(--ats-radius-lg);
    box-shadow: var(--ats-shadow-md);
    overflow: hidden;
    border: 1px solid var(--ats-border);
}

.ats-applications-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.ats-applications-table thead {
    background: var(--ats-bg-tertiary);
}

.ats-applications-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--ats-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--ats-border);
}

.ats-applications-table tbody tr {
    transition: var(--ats-transition);
    border-bottom: 1px solid var(--ats-border-light);
}

.ats-applications-table tbody tr:hover {
    background: var(--ats-bg-secondary);
    transform: scale(1.01);
    box-shadow: inset 0 0 0 2px var(--ats-primary);
}

.ats-applications-table tbody tr:last-child {
    border-bottom: none;
}

.ats-applications-table tbody td {
    padding: 20px;
    color: var(--ats-text-primary);
    font-size: 14px;
}

.ats-applications-table tbody td strong {
    font-weight: 600;
    color: var(--ats-text-primary);
}

.ats-applications-table tbody td small {
    color: var(--ats-text-tertiary);
    font-size: 13px;
}

.ats-applications-table tbody td a {
    color: var(--ats-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--ats-transition-fast);
}

.ats-applications-table tbody td a:hover {
    color: var(--ats-primary-dark);
    text-decoration: underline;
}

/* Checkbox Styling */
.ats-select-all,
.ats-select-application {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--ats-primary);
}

/* ========================================
   Status Select - Modern Dropdown
   ======================================== */
.ats-status-select {
    padding: 8px 16px;
    border: 2px solid var(--ats-border);
    border-radius: var(--ats-radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: var(--ats-bg-primary);
    color: var(--ats-text-primary);
    transition: var(--ats-transition);
}

.ats-status-select:hover {
    border-color: var(--ats-primary);
}

.ats-status-select:focus {
    outline: none;
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ========================================
   Buttons - Modern Gradient Design
   ======================================== */
.ats-btn-small {
    padding: 10px 20px;
    border: none;
    border-radius: var(--ats-radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ats-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.ats-view-application {
    background: linear-gradient(135deg, var(--ats-primary) 0%, var(--ats-secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ats-view-application::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.ats-view-application:hover::before {
    left: 100%;
}

.ats-view-application:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.ats-btn-small[download] {
    background: var(--ats-bg-tertiary);
    color: var(--ats-text-primary);
    border: 2px solid var(--ats-border);
}

.ats-btn-small[download]:hover {
    background: var(--ats-success);
    color: white;
    border-color: var(--ats-success);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ========================================
   Bulk Actions - Modern Control Bar
   ======================================== */
.ats-bulk-actions {
    margin-top: 24px;
    padding: 20px 24px;
    background: var(--ats-bg-primary);
    border-radius: var(--ats-radius-lg);
    box-shadow: var(--ats-shadow-md);
    display: flex;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--ats-border);
}

.ats-bulk-actions select {
    flex: 1;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid var(--ats-border);
    border-radius: var(--ats-radius-md);
    font-size: 14px;
    font-weight: 500;
    background: var(--ats-bg-primary);
    color: var(--ats-text-primary);
    cursor: pointer;
    transition: var(--ats-transition);
}

.ats-bulk-actions select:focus {
    outline: none;
    border-color: var(--ats-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.ats-bulk-actions button {
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--ats-primary) 0%, var(--ats-secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--ats-radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ats-transition);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ats-bulk-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ========================================
   Modal - Modern Glassmorphism Design
   ======================================== */
.ats-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.ats-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
    }
    to { 
        opacity: 1;
    }
}

.ats-modal-content {
    background: var(--ats-bg-primary);
    border-radius: var(--ats-radius-xl);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--ats-shadow-xl);
    border: 1px solid var(--ats-border);
}

@keyframes slideUp {
    from {
        transform: translateY(50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.ats-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--ats-text-tertiary);
    cursor: pointer;
    transition: var(--ats-transition);
    border-radius: 50%;
    background: var(--ats-bg-tertiary);
    z-index: 10;
}

.ats-modal-close:hover {
    background: var(--ats-danger);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

#atsApplicationDetails {
    padding: 40px;
}

/* ========================================
   Empty State - Friendly Design
   ======================================== */
.ats-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--ats-bg-primary);
    border-radius: var(--ats-radius-lg);
    box-shadow: var(--ats-shadow-md);
    border: 2px dashed var(--ats-border);
}

.ats-empty-state p {
    color: var(--ats-text-secondary);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .recruiter-dashboard-page .container {
        padding: 24px 16px 60px;
    }
    
    .ats-dashboard-header h1 {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .recruiter-dashboard-page {
        padding-top: 60px;
    }
    
    .hic-dashboard-widget {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .hic-widget-button {
        width: 100%;
        justify-content: center;
    }
    
    .ats-filter-form {
        flex-direction: column;
    }
    
    .ats-filter-form select {
        width: 100%;
    }
    
    .ats-applications-table-wrapper {
        overflow-x: auto;
    }
    
    .ats-applications-table {
        min-width: 800px;
    }
    
    .ats-bulk-actions {
        flex-direction: column;
    }
    
    .ats-bulk-actions select {
        max-width: 100%;
        width: 100%;
    }
    
    .ats-bulk-actions button {
        width: 100%;
    }
    
    #atsApplicationDetails {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .ats-dashboard-header h1 {
        font-size: 24px;
    }
    
    .hic-widget-balance {
        font-size: 28px;
    }
}

/* ========================================
   Loading States & Animations
   ======================================== */
.ats-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.ats-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--ats-bg-tertiary);
    border-top-color: var(--ats-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--ats-primary);
    outline-offset: 2px;
}
