/* American Power Systems Career Portal Custom Styles */

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    z-index: 1000;
    padding: 8px 16px;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: top 0.2s ease-in-out;
}

.skip-link:focus,
.skip-link:active {
    position: absolute;
    top: 6px;
    color: #fff;
    text-decoration: underline;
}

/* Enhanced Focus Indicators - Consistent with American Power Systems Brand */
*:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
    border-radius: 2px;
}

/* High contrast focus for interactive elements - WCAG 2.1 AA Compliant */
.btn:focus,
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
    box-shadow: 0 0 0 3px rgba(56, 56, 163, 0.25);
}

/* Screen Reader Only Text */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .alert {
        animation: none !important;
    }
    
    .btn.loading::after {
        animation: none !important;
    }
}

:root {
    /* American Power Systems Brand Colors - Red, White, Blue */
    --aps-red: #DC2626; /* Accent color - 10% usage */
    --aps-blue: #1a5490; /* Primary color - 20% usage - True blue matching logo */
    --aps-white: #FFFFFF; /* Dominant color - 70% usage */
    
    /* Primary Brand System */
    --primary-color: var(--aps-blue);
    --accent-color: var(--aps-red);
    --surface-color: var(--aps-white);
    
    /* Focus System - Consistent with jobs.css */
    --focus-ring: var(--aps-blue);
    --focus-ring-offset: 2px;
    
    /* Extended Palette */
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0284c7;
    --warning-color: #d97706;
    --danger-color: var(--aps-red);
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    /* Accessibility Colors - WCAG AA Compliant */
    --focus-color: var(--aps-blue);
    --focus-color-contrast: var(--aps-white);
    --text-high-contrast: #000;
    --link-color: var(--aps-blue);
    --link-hover-color: #2C3E50;
    --error-text: #991b1b; /* Higher contrast red for text */
    --success-text: #0f4c3a;
    
    /* Typography - Inter Font System */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Sticky Footer Layout - Flexbox Implementation */
html {
    height: 100%;
}

body {
    font-family: var(--font-primary);
    background-image: url('/images/battery-storage-background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--dark-color);
    position: relative;
    /* Body compensation for fixed navbar */
    padding-top: 72px !important;
    /* Flexbox layout for sticky footer */
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Blue tint overlay for background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(56, 56, 163, 0.3);
    z-index: -1;
    pointer-events: none;
}

/* Dashboard Page - Uses same sidebar backgrounds via body::before and ::after */
body.dashboard-page {
    /* Sidebar backgrounds inherited from body pseudo-elements */
}

/* Dashboard Content Wrapper - White Background for Content Area */
.dashboard-content-wrapper {
    background: var(--aps-white);
    border-radius: 0;
    box-shadow: none;
    padding: 2rem;
    margin: 0;
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 200px);
}

/* Mobile performance - sidebar backgrounds already hidden via body::before/::after media queries */
@media (max-width: 768px) {
    /* Reduce min-height on mobile to prevent excess whitespace */
    .dashboard-content-wrapper {
        min-height: auto;
    }
}

/* Hero section - American Power Systems Branding with Battery Background */
.hero-section {
    background-image: url('/images/hero-battery-background.png?v=1730659200');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--aps-white);
    padding: 3rem 0;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border-left: 4px solid #00d4ff;
    box-shadow: -8px 0 24px rgba(0, 212, 255, 0.6), -4px 0 12px rgba(0, 212, 255, 0.8);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(29, 78, 216, 0.65);
    z-index: 0;
}

.hero-section > * {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-section .lead {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Statistics cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
    background: var(--aps-blue);
}

.card.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
}

.card.bg-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #087990 100%);
}

.card.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #cc9a00 100%);
}

/* Logo styling */
.navbar-brand img {
    border-radius: 4px;
    transition: transform 0.2s ease-in-out;
    object-fit: contain;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

/* List groups */
.list-group-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

/* Job description preview */
#jobDescriptionPreview {
    min-height: 100px;
    white-space: pre-line;
}

/* ===== LOADING INDICATOR STYLES ===== */

/* Loading indicator for auto-population processes */
.loading-indicator {
    padding: 2rem 1rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    transition: all 0.3s ease;
}

.loading-indicator i {
    font-size: 1.2rem;
    color: var(--aps-blue) !important;
    margin-right: 0.5rem;
}

.loading-indicator span {
    font-weight: 500;
    color: #64748b;
    font-size: 0.95rem;
}

/* Enhanced spinner animation for better visibility */
.loading-indicator .fa-spin {
    animation: enhanced-spin 1s linear infinite;
}

@keyframes enhanced-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading indicator hover state for better interactivity */
.loading-indicator:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #94a3b8;
}

/* Mobile responsive adjustments for loading indicator */
@media (max-width: 768px) {
    .loading-indicator {
        padding: 1.5rem 0.75rem;
    }
    
    .loading-indicator i {
        font-size: 1.1rem;
    }
    
    .loading-indicator span {
        font-size: 0.9rem;
    }
}

/* Admin interface */
.job-title-item {
    background-color: #f8f9fa;
    transition: all 0.15s ease-in-out;
}

.job-title-item:hover {
    background-color: #e9ecef;
}

.location-item {
    transition: all 0.15s ease-in-out;
}

/* Page Title Background - Create Job Title Page */
.admin-page-title {
    background-color: var(--aps-white);
    border-radius: var(--radius-md, 8px);
    padding: 1.5rem;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

/* Responsive adjustments for page title */
@media (max-width: 768px) {
    .admin-page-title {
        padding: 1rem;
        margin-bottom: 0;
    }
}

/* Features section */
.features-section {
    padding: 2rem 0;
}

.features-section .fas {
    color: var(--aps-blue);
}

/* Main content area should flex to fill available space */
main.container {
    flex: 1 0 auto;
}

/* Footer - Sticky Footer Implementation */
footer {
    margin-top: auto;
    flex-shrink: 0;
    background-color: #f8f9fa !important;
}

/* Alert animations */
.alert {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states */
.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Job detail specific styles */
.job-description h6 {
    color: var(--aps-blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.custom-description h6 {
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.template-content h6 {
    color: var(--info-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
}

nav[aria-label="breadcrumb"] {
    border-radius: 0 !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--secondary-color);
}

/* Table styles */
.table {
    background-color: white;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== FLOATING NAVBAR IMPLEMENTATION ===== */

/* Floating navbar with modern design */
.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: #ffffff !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 72px;
    border: none !important;
    border-bottom: none !important;
}

/* Blue border matching footer */
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--aps-blue);
    z-index: 1;
}

/* Enhanced scroll effects */
.navbar.scrolled {
    background: rgba(255, 255, 255, 1.0) !important;
    box-shadow: none !important;
    backdrop-filter: blur(25px);
    border: none !important;
    border-bottom: none !important;
}

/* Bold brand text styling */
.navbar-brand {
    font-weight: bold !important;
    color: #000000 !important;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.navbar-brand:hover {
    color: #333333 !important;
    text-decoration: none;
}

/* Dark login text for white navbar */
.navbar .nav-link {
    color: #333333 !important;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.navbar .nav-link:hover {
    color: #000000 !important;
}

/* Responsive adjustments for floating navbar */
@media (max-width: 1024px) {
    body {
        padding-top: 68px !important;
    }
    .navbar {
        min-height: 68px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 64px !important;
    }
    .navbar {
        min-height: 64px;
    }
    
    /* Reduce logo size on tablets to fit better */
    .navbar-brand img {
        height: 32px !important;
        max-width: 220px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px !important;
    }
    .navbar {
        min-height: 60px;
    }
    
    /* Further reduce logo size on mobile for same-line layout with hamburger */
    .navbar-brand img {
        height: 28px !important;
        max-width: 180px;
    }
    
    /* Reduce container padding on mobile to maximize space */
    .navbar .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Ensure navbar items stay on same line */
    .navbar-brand {
        margin-right: 8px;
    }
}

/* Accessibility: Reduced motion support for floating navbar */
@media (prefers-reduced-motion: reduce) {
    .navbar {
        transition: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .card-header,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .container {
        width: 100% !important;
        max-width: none !important;
    }
}

/* ===== MODERN DASHBOARD CONTAINER ENHANCEMENTS ===== */
/* American Power Systems Professional Dashboard Modernization */

/* ===== ENHANCED ANALYTICS CARDS ===== */

/* Modern Dashboard Analytics Cards - Primary Blue Card */
.modern-dashboard-card {
    background: linear-gradient(135deg, var(--aps-blue) 0%, #2c2c7a 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(56, 56, 163, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    overflow: hidden;
    position: relative;
}

/* Complete hover effect neutralization for analytics cards */
.modern-dashboard-card, 
.modern-dashboard-card:hover {
    box-shadow: 0 4px 20px rgba(56, 56, 163, 0.15) !important;
    transition: none !important;
    transform: none !important;
}

.modern-dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 110px;
    height: 110px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(35px, -35px);
    transition: all 0.3s ease;
}

/* Hover animations removed per user request */
.modern-dashboard-card:hover {
    /* transform: translateY(-2px); */
    /* box-shadow: 0 8px 30px rgba(56, 56, 163, 0.25); */
}

.modern-dashboard-card:hover::before {
    /* transform: translate(20px, -20px) scale(1.1); */
}

/* Success Card - Green Gradient */
.modern-dashboard-card.modern-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.15);
}

.modern-dashboard-card.modern-success:hover {
    box-shadow: 0 8px 30px rgba(5, 150, 105, 0.25);
}

/* Info Card - Cyan Gradient */
.modern-dashboard-card.modern-info {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.15);
}

.modern-dashboard-card.modern-info:hover {
    box-shadow: 0 8px 30px rgba(2, 132, 199, 0.25);
}

/* Warning Card - Orange Gradient with WCAG AA Compliant Text */
.modern-dashboard-card.modern-warning {
    background: linear-gradient(135deg, #92400e 0%, #7c2d12 100%) !important;
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.15);
}

.modern-dashboard-card.modern-warning:hover {
    box-shadow: 0 8px 30px rgba(217, 119, 6, 0.25);
}

/* WCAG AA Compliant Text Colors for Orange Warning Card - Override per user request */
.modern-dashboard-card.modern-warning .card-body p {
    color: #ffffff !important; /* White text per user requirement */
    font-weight: 600; /* Enhanced weight for better readability */
}

.modern-dashboard-card.modern-warning .card-body h2 {
    color: #ffffff; /* Keep white for numbers - large text passes 3:1 requirement */
}

/* Enhanced card body styling */
.modern-dashboard-card .card-body {
    position: relative;
    z-index: 2;
    padding: 1.5rem;
}

/* Modern typography for analytics cards */
.modern-dashboard-card h2 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.modern-dashboard-card p {
    font-weight: 500;
    opacity: 0.9;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

/* Enhanced icons for analytics cards */
.modern-dashboard-card .fa-2x {
    opacity: 0.8;
    transition: all 0.2s ease;
}

.modern-dashboard-card:hover .fa-2x {
    /* opacity: 1; */
    /* transform: scale(1.1); */
}

/* ===== REFINED MULTI-TAB CONTAINER ===== */

/* Modern Tab Container */
.modern-tab-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.modern-tab-container:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Enhanced Tab Navigation */
.modern-nav-tabs {
    border-bottom: none;
    background: #f8fafc;
    padding: 0.5rem 1rem 0;
    margin-bottom: 0;
}

.modern-nav-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    border: none;
    padding: 12px 24px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    transition: all 0.2s ease;
    margin-right: 0.25rem;
    position: relative;
}

.modern-nav-tabs .nav-link:hover {
    color: var(--aps-blue);
    background: rgba(56, 56, 163, 0.05);
    transform: translateY(-1px);
}

.modern-nav-tabs .nav-link.active {
    color: var(--aps-blue);
    background: #ffffff;
    border-bottom: 2px solid var(--aps-blue);
    font-weight: 600;
}

.modern-nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--aps-blue);
}

/* Enhanced Tab Content */
.modern-tab-container .card-body {
    padding: 1.5rem;
    background: #ffffff;
}

/* Enhanced Job List Items with Prominent Borders */
.modern-job-item {
    background: #ffffff;
    border: 2px solid #cbd5e1; /* Enhanced border thickness and color */
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Slightly enhanced shadow */
    position: relative;
}

.modern-job-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--aps-blue);
    border-width: 2px; /* Maintain enhanced border on hover */
}

/* Additional visual separation for better hierarchy */
.modern-job-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -0.375rem;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e2e8f0 50%, transparent 100%);
}

/* Fix CSS specificity conflicts between Bootstrap list-group-item and modern-job-item */
.list-group .modern-job-item {
    border: 2px solid #cbd5e1 !important; /* Override Bootstrap's border: none */
    border-radius: 8px !important;
    margin-bottom: 0.75rem !important;
    padding: 1.25rem !important; /* Override Bootstrap's padding */
    background: #ffffff !important;
}

.list-group .modern-job-item:hover {
    border-color: var(--aps-blue) !important;
    border-width: 2px !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.modern-job-item .fw-bold a {
    color: #1e293b;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
}

.modern-job-item .fw-bold a:hover {
    color: var(--aps-blue);
}

.modern-job-item .text-muted {
    color: #64748b !important;
    font-size: 0.875rem;
}

/* Enhanced Empty State */
.modern-empty-state {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed #cbd5e1;
}

.modern-empty-state .fa-3x {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.modern-empty-state h3 {
    color: #475569;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.modern-empty-state p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* ===== DASHBOARD ACTION BUTTON ENHANCEMENTS ===== */

/* White Button Icons for Better Contrast - WCAG 2.1 AA Compliant */
.modern-btn-success i, 
.btn.modern-btn-success i {
    color: #ffffff !important;
}

.modern-btn-danger i, 
.btn.modern-btn-danger i {
    color: #ffffff !important;
}

/* Connected Button Groups - Seamless Integration */
.btn-group {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0;
    padding: 0.5rem 0.75rem;
    min-width: 44px;
    position: relative;
}

.btn-group .btn:first-child {
    border-radius: 6px 0 0 6px !important;
}

.btn-group .btn:last-child {
    border-radius: 0 6px 6px 0 !important;
    border-right: none;
}

/* Remove default form styling that breaks button groups */
.btn-group form {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}

.btn-group form .btn {
    border-left: none;
}

/* Enhanced hover effects for connected buttons */
.btn-group .btn:hover {
    z-index: 2;
    transform: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Ensure consistent button heights */
.btn-group .modern-btn-primary,
.btn-group .modern-btn-success,
.btn-group .modern-btn-danger,
.btn-group .modern-btn-secondary {
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== SOPHISTICATED MANAGEMENT CONTAINERS ===== */

/* Modern Management Cards */
.modern-management-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    overflow: hidden;
}

.modern-management-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

/* Enhanced Management Card Headers */
.modern-management-card .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

.modern-management-card .card-header h5 {
    color: #1e293b;
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
}

.modern-management-card .card-header .fas {
    color: var(--aps-blue);
    margin-right: 0.5rem;
}

/* Enhanced Management Card Body */
.modern-management-card .card-body {
    padding: 1.5rem;
    background: #ffffff;
}

/* Modern Form Enhancements */
.modern-form-control {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.modern-form-control:focus {
    border-color: var(--aps-blue);
    box-shadow: 0 0 0 3px rgba(56, 56, 163, 0.1);
    outline: none;
}

.modern-form-control:hover {
    border-color: #9ca3af;
}

/* Enhanced Form Labels */
.modern-form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

/* Modern Job Title Item Container */
.modern-job-title-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.modern-job-title-item:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: var(--aps-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Enhanced Location Items */
.modern-location-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.modern-location-item:hover {
    border-color: var(--aps-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Fixed Height Management Containers */
.fixed-height-management-container {
    height: 320px;
    overflow-y: auto;
    padding: 0.5rem;
    border-radius: 8px;
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.fixed-height-management-container:hover {
    border-color: #d1d5db;
}

/* Custom scrollbar styling for management containers */
.fixed-height-management-container::-webkit-scrollbar {
    width: 8px;
}

.fixed-height-management-container::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.fixed-height-management-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.fixed-height-management-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Ensure proper spacing within scrollable containers */
.fixed-height-management-container .modern-job-title-item:last-child,
.fixed-height-management-container .modern-location-item:last-child {
    margin-bottom: 0;
}

/* Accessibility: Focus management for scrollable containers */
.fixed-height-management-container:focus-within {
    border-color: var(--aps-blue);
    box-shadow: 0 0 0 3px rgba(56, 56, 163, 0.1);
}

/* Reduced motion support for scrollable containers */
@media (prefers-reduced-motion: reduce) {
    .fixed-height-management-container {
        scroll-behavior: auto !important;
    }
}

/* Modern Button Enhancements */
.modern-btn-primary {
    background: linear-gradient(135deg, var(--aps-blue) 0%, #2c2c7a 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(56, 56, 163, 0.2);
}

.modern-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 56, 163, 0.3);
    background: linear-gradient(135deg, #2c2c7a 0%, var(--aps-blue) 100%);
}

/* White text and icons for all modern action buttons */
.modern-btn-primary,
.modern-btn-success,
.modern-btn-danger,
.modern-btn-secondary {
    color: white !important;
}

/* Ensure hover states maintain white text */
.modern-btn-primary:hover,
.modern-btn-success:hover,
.modern-btn-danger:hover,
.modern-btn-secondary:hover {
    color: white !important;
}

/* Icon visibility fix for modern buttons */
.modern-btn-primary i,
.modern-btn-success i,
.modern-btn-danger i,
.modern-btn-secondary i,
.btn-primary i {
    color: white !important;
}

.modern-btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.modern-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

.modern-btn-danger {
    background: linear-gradient(135deg, var(--aps-red) 0%, #b91c1c 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.modern-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    background: linear-gradient(135deg, #b91c1c 0%, var(--aps-red) 100%);
}

.modern-btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: 2px solid #6c757d;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
    text-decoration: none;
}

.modern-btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    border-color: #545b62;
    color: #ffffff;
    text-decoration: none;
}

/* Icon visibility fix for secondary buttons */
.modern-btn-secondary i {
    color: inherit !important;
}

/* Modern User Management Table */
.modern-user-table {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.modern-user-table .table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    padding: 1rem;
}

.modern-user-table .table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.modern-user-table .table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Enhanced Badge Styling */
.modern-badge-admin {
    background: linear-gradient(135deg, var(--aps-red) 0%, #b91c1c 100%);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

.modern-badge-user {
    background: linear-gradient(135deg, var(--aps-blue) 0%, #2c2c7a 100%);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

/* Status Badge Styling for Admin Views */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    text-transform: capitalize;
}

.status-badge.active {
    background-color: #22c55e;
    color: white;
}

.status-badge.draft {
    background-color: #f59e0b;
    color: white;
}

.status-badge.archived {
    background-color: #6b7280;
    color: white;
}

.status-badge.inactive {
    background-color: #ef4444;
    color: white;
}

.status-badge.closed {
    background-color: #dc2626;
    color: white;
}

.status-badge.filled {
    background-color: #10b981;
    color: white;
}

.status-badge.pending {
    background-color: #f59e0b;
    color: white;
}

/* Job Status Badge Styling for Public Views */
.job-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    text-transform: capitalize;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.job-status-badge.job-status-active {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.job-status-badge.job-status-draft {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.job-status-badge.job-status-archived {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.job-status-badge.job-status-inactive {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.job-status-badge.job-status-closed {
    background-color: #fecaca;
    color: #991b1b;
    border: 1px solid #f87171;
}

.job-status-badge.job-status-filled {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.job-status-badge.job-status-pending {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ===== BUTTON GROUP FIXES ===== */

/* Fix Bootstrap button group styling for modern buttons */
.btn-group > .modern-btn-primary:not(:first-child),
.btn-group > .modern-btn-success:not(:first-child),
.btn-group > .modern-btn-danger:not(:first-child),
.btn-group > .modern-btn-secondary:not(:first-child),
.btn-group > form:not(:first-child) > .modern-btn-primary,
.btn-group > form:not(:first-child) > .modern-btn-success,
.btn-group > form:not(:first-child) > .modern-btn-danger,
.btn-group > form:not(:first-child) > .modern-btn-secondary {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.btn-group > .modern-btn-primary:not(:last-child),
.btn-group > .modern-btn-success:not(:last-child),
.btn-group > .modern-btn-danger:not(:last-child),
.btn-group > .modern-btn-secondary:not(:last-child),
.btn-group > form:not(:last-child) > .modern-btn-primary,
.btn-group > form:not(:last-child) > .modern-btn-success,
.btn-group > form:not(:last-child) > .modern-btn-danger,
.btn-group > form:not(:last-child) > .modern-btn-secondary {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Special handling for buttons inside forms within button groups */
.btn-group > form.d-inline {
    display: inline-block !important;
}

/* Ensure seamless connection between form-wrapped buttons */
.btn-group > form:not(:first-child):not(:last-child) > .btn {
    border-radius: 0 !important;
}

/* ===== RESPONSIVE ENHANCEMENTS ===== */

/* Mobile optimizations for modern dashboard */
@media (max-width: 768px) {
    .modern-dashboard-card {
        margin-bottom: 1rem;
    }
    
    .modern-dashboard-card h2 {
        font-size: 2rem;
    }
    
    .modern-tab-container {
        border-radius: 8px;
    }
    
    .modern-nav-tabs .nav-link {
        padding: 10px 16px;
        font-size: 0.875rem;
    }
    
    .modern-management-card {
        margin-bottom: 1.5rem;
    }
    
    .modern-job-title-item {
        padding: 1rem;
    }
}

/* Accessibility enhancements for modern components */
@media (prefers-reduced-motion: reduce) {
    .modern-dashboard-card,
    .modern-tab-container,
    .modern-management-card,
    .modern-job-item,
    .modern-btn-primary,
    .modern-btn-success,
    .modern-btn-danger {
        transition: none !important;
        transform: none !important;
    }
    
    .modern-dashboard-card:hover,
    .modern-tab-container:hover,
    .modern-management-card:hover {
        transform: none !important;
    }
}

/* ===== APS APPLY MODAL STYLING ===== */

/* Modal Content - American Power Systems Branding */
.aps-modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(56, 56, 163, 0.15);
    overflow: hidden;
}

/* Modal Header */
.aps-modal-header {
    background: linear-gradient(135deg, var(--aps-blue) 0%, #2C5AA0 100%);
    color: var(--aps-white);
    padding: 1.5rem 2rem;
    border-bottom: none;
    position: relative;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.aps-modal-icon {
    font-size: 1.5rem;
    color: var(--aps-white);
    opacity: 0.9;
}

.aps-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--aps-white);
}

.aps-btn-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--aps-white);
    opacity: 0.8;
    font-size: 1rem;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.aps-btn-close:hover,
.aps-btn-close:focus {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: scale(1.05);
}

/* Modal Body */
.aps-modal-body {
    padding: 2rem;
    background-color: var(--aps-white);
}

/* Job Context Section */
.aps-job-context {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid rgba(56, 56, 163, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

.job-context-header {
    text-align: center;
}

.job-context-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--aps-blue);
    margin-bottom: 0.5rem;
}

.job-context-location {
    color: var(--secondary-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.job-context-location i {
    color: var(--aps-red);
}

/* Application Options */
.aps-apply-option {
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: #ffffff;
    border-radius: 10px;
}

.aps-apply-option:hover {
    border-color: var(--aps-blue);
    box-shadow: 0 5px 15px rgba(56, 56, 163, 0.1);
    transform: translateY(-2px);
}

.aps-option-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
}

.aps-email-icon {
    background: linear-gradient(135deg, var(--aps-blue) 0%, #4a50e2 100%);
    color: var(--aps-white);
}

.aps-form-icon {
    background: linear-gradient(135deg, var(--aps-red) 0%, #ee5a52 100%);
    color: var(--aps-white);
}

.aps-option-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.aps-option-description {
    color: var(--secondary-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Modal Buttons */
.aps-btn-email,
.aps-btn-form {
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.aps-btn-email {
    background: var(--aps-blue);
    border: 2px solid var(--aps-blue);
    color: var(--aps-white);
}

.aps-btn-email:hover,
.aps-btn-email:focus {
    background: #2C5AA0;
    border-color: #2C5AA0;
    color: var(--aps-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 56, 163, 0.25);
}

.aps-btn-form {
    background: var(--aps-red);
    border: 2px solid var(--aps-red);
    color: var(--aps-white);
}

.aps-btn-form:hover,
.aps-btn-form:focus {
    background: #b91c1c;
    border-color: #b91c1c;
    color: var(--aps-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

/* Apply Footer */
.aps-apply-footer {
    border-top: 1px solid #e5e7eb;
}

.aps-link {
    color: var(--aps-blue);
    text-decoration: none;
    font-weight: 500;
}

.aps-link:hover,
.aps-link:focus {
    color: #2C5AA0;
    text-decoration: underline;
}

/* Responsive Design for Apply Modal */
@media (max-width: 768px) {
    .aps-modal-body {
        padding: 1.5rem 1rem;
    }
    
    .aps-job-context {
        padding: 1rem;
    }
    
    .aps-apply-option .card-body {
        flex-direction: column;
        text-align: center;
    }
    
    .aps-option-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}

/* Button styling for apply buttons */
.aps-apply-button {
    border: none;
    background: inherit;
    color: inherit;
    font: inherit;
    cursor: pointer;
    width: 100%;
}

.aps-apply-button:hover,
.aps-apply-button:focus {
    color: inherit;
}

/* ===================================================================
   JOB LOCATION MAP SECTION
   ================================================================ */

.job-map-section {
    padding: 5rem 0;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
    border-left: 4px solid #00d4ff;
    border-right: 4px solid #ff6b35;
    border-top: none;
    border-bottom: none;
}

.job-map-section::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -24px;
    width: 24px;
    background: linear-gradient(to left, rgba(0, 212, 255, 0.8) 0%, rgba(0, 212, 255, 0.4) 50%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.job-map-section::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: -24px;
    width: 24px;
    background: linear-gradient(to right, rgba(255, 107, 53, 0.8) 0%, rgba(255, 0, 128, 0.4) 50%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.map-header {
    margin-bottom: 3rem;
}

.map-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

#jobLocationMap {
    height: 600px;
    width: 100%;
    border-radius: 16px;
    z-index: 1;
}

.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.map-loading i {
    font-size: 2.5rem;
    color: var(--aps-red);
    margin-bottom: 1rem;
    display: block;
}

.map-loading span {
    font-size: 1rem;
    color: var(--dark-grey);
    font-weight: 500;
}

.custom-map-marker {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-map-marker i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

.custom-map-marker:hover i {
    transform: scale(1.1);
}

.job-location-popup {
    padding: 0.5rem 0;
}

.popup-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-grey);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--aps-red);
}

.popup-count {
    font-size: 0.95rem;
    color: var(--dark-grey);
    margin: 0.5rem 0;
}

.popup-job-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    max-height: 200px;
    overflow-y: auto;
}

.popup-job-list li {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(29, 78, 216, 0.03);
    transition: background 0.2s ease;
}

.popup-job-list li:hover {
    background: rgba(29, 78, 216, 0.08);
}

.popup-job-link {
    text-decoration: none;
    color: var(--aps-blue);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.popup-job-link:hover {
    color: var(--aps-red);
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.leaflet-popup-content {
    margin: 1rem;
    font-family: 'Inter', sans-serif;
    min-width: 250px;
}

.leaflet-popup-tip {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.map-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--dark-grey);
    font-weight: 500;
}

.legend-item i {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .job-map-section {
        padding: 3rem 0;
    }
    
    #jobLocationMap {
        height: 450px;
    }
    
    .popup-title {
        font-size: 1.1rem;
    }
    
    .popup-job-list {
        max-height: 150px;
    }
    
    .map-legend {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    #jobLocationMap {
        height: 350px;
        border-radius: 12px;
    }
    
    .map-container {
        border-radius: 12px;
    }
    
    .leaflet-popup-content {
        min-width: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .custom-map-marker i {
        transition: none;
    }
    
    .custom-map-marker:hover i {
        transform: none;
    }
    
    .popup-job-list li {
        transition: none;
    }
}

/* ============================================
   Quill Rich Text Editor Styling
   ============================================ */

/* Rich Text Editor Container */
.rich-text-editor {
    box-sizing: border-box;
    position: static;
    display: block;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    min-height: 18rem;
    max-height: 18rem;
    overflow: hidden;
}

/* Quill Toolbar */
.ql-toolbar {
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    border: none;
    border-bottom: 1px solid #ddd;
    padding: 8px;
}

.rich-text-editor .ql-toolbar {
    flex: 0 0 auto;
}

/* Quill Editor Content Area */
.ql-container {
    border: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

.rich-text-editor .ql-container {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(18rem - 42px);
    overflow-y: auto;
}

.ql-editor {
    padding: 16px;
}

.rich-text-editor .ql-editor {
    position: relative;
    min-height: 0 !important;
    padding: 1rem;
}

/* Placeholder Text */
.rich-text-editor .ql-editor.ql-blank::before {
    color: #999;
    font-style: normal;
    left: 1rem !important;
    right: 1rem !important;
    pointer-events: none;
}

/* Toolbar Button Hover States */
.ql-toolbar button:hover,
.ql-toolbar button:focus {
    color: #00d4ff;
}

.ql-toolbar button.ql-active {
    color: #00d4ff;
}

/* Toolbar Icons */
.ql-stroke {
    stroke: #333;
}

.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button:focus .ql-stroke {
    stroke: #00d4ff;
}

.ql-toolbar button.ql-active .ql-stroke {
    stroke: #00d4ff;
}

.ql-fill {
    fill: #333;
}

.ql-toolbar button:hover .ql-fill,
.ql-toolbar button:focus .ql-fill {
    fill: #00d4ff;
}

.ql-toolbar button.ql-active .ql-fill {
    fill: #00d4ff;
}

/* Link Tooltip */
.ql-tooltip {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
}

.ql-tooltip input[type="text"] {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
}

.ql-tooltip .ql-action,
.ql-tooltip .ql-remove {
    color: #00d4ff;
    cursor: pointer;
}

.ql-tooltip .ql-action:hover,
.ql-tooltip .ql-remove:hover {
    text-decoration: underline;
}

/* Editor Content Formatting */
.ql-editor p {
    margin-bottom: 0.5rem;
}

.ql-editor strong {
    font-weight: 600;
}

.ql-editor em {
    font-style: italic;
}

.ql-editor a {
    color: #00d4ff;
    text-decoration: none;
}

.ql-editor a:hover {
    text-decoration: underline;
}

.ql-editor ul,
.ql-editor ol {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.ql-editor li {
    margin-bottom: 0.25rem;
}

/* Accessibility: Focus Indicators */
.ql-editor:focus {
    outline: none;
}

.ql-toolbar button:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Responsive: Mobile Toolbar */
@media (max-width: 768px) {
    .ql-toolbar {
        padding: 6px;
    }
    
    .ql-editor {
        padding: 12px;
        font-size: 14px;
    }
    
    .ql-toolbar button {
        width: 32px;
        height: 32px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .rich-text-editor {
        border: 2px solid #000;
    }
    
    .ql-toolbar {
        border-bottom: 2px solid #000;
    }
    
    .ql-stroke {
        stroke: #000;
    }
    
    .ql-fill {
        fill: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .ql-toolbar button,
    .ql-editor {
        transition: none;
    }
}

/* ============================================
   Application Form Page - Unified Layout (Like Main Page)
   ============================================ */

/* Remove all gaps */
.application-page-unified nav[aria-label="breadcrumb"] {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Hero Section (Blue - Compact Design) */
.application-hero-section {
    background: var(--aps-blue);
    padding: 2rem 2rem 1.5rem;
    margin: 0;
    border-radius: 0;
    position: relative;
}

.application-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    color: white;
}

.hero-icon {
    display: none; /* Remove icon for cleaner look */
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hide "Apply for Position" title on application form page only */
.application-page-unified .hero-title {
    display: none;
}

.job-info-display {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.job-title-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    text-align: left;
}

.job-meta-items {
    display: flex;
    gap: 2rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
}

.job-meta-items .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.job-meta-items .meta-item i {
    opacity: 0.8;
}

/* White Form Section (Like "Current Openings" section) */
.application-form-section {
    background: white;
    padding: 3rem 2rem;
    margin-top: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
}

/* Form Sections */
.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.form-subsection-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--aps-blue);
    box-shadow: 0 0 0 3px rgba(56, 56, 163, 0.1);
}

.form-control.is-invalid {
    border-color: var(--aps-red);
}

.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    margin-bottom: 3rem;
}

.btn-cancel {
    background-color: var(--secondary-color);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-cancel:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.btn-submit {
    background: var(--aps-blue);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-submit:hover {
    background: #3333b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 56, 163, 0.3);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Help Section (Integrated in white section) */
.application-help-section {
    background: var(--surface-container);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.help-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.help-icon {
    font-size: 2rem;
    color: var(--aps-blue);
    flex-shrink: 0;
}

.help-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.help-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.help-text a {
    color: var(--aps-blue);
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .application-hero-section {
        padding: 1.5rem 1.25rem;
    }

    .hero-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .job-title-text {
        font-size: 1.5rem;
    }

    .job-meta-items {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.875rem;
    }

    .application-form-section {
        padding: 2rem 1.5rem;
        margin-top: var(--spacing-xl);
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ========================================
   Benefits Slideshow Section
   ======================================== */
.benefits-slideshow-section {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #1a1a2e;
}

.slideshow-container {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.slides-wrapper {
    display: flex;
    height: 100%;
    width: 700%;
    transition: transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.benefit-slide {
    position: relative;
    flex: 0 0 14.285714%;
    width: 14.285714%;
    height: 100%;
}

.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 212, 255, 0.7) 0%,
        rgba(26, 26, 46, 0.85) 50%,
        rgba(255, 107, 53, 0.7) 100%
    );
    z-index: 1;
}

.slide-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.benefit-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(0, 212, 255, 0.5);
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.3),
        0 0 40px rgba(255, 107, 53, 0.2);
}

.benefit-icon i {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.benefit-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 212, 255, 0.3);
    line-height: 1.2;
}

.benefit-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Navigation Dots */
.slideshow-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 12px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.dot.active {
    background: #00d4ff;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

/* Navigation Arrows */
.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.slide-nav:hover {
    background: rgba(0, 212, 255, 0.4);
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

.slide-nav.prev {
    left: 30px;
}

.slide-nav.next {
    right: 30px;
}

.slide-nav i {
    font-size: 1.25rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .slideshow-container {
        height: 280px;
    }

    .benefit-title {
        font-size: 2rem;
    }

    .benefit-description {
        font-size: 1.125rem;
    }

    .benefit-icon {
        width: 70px;
        height: 70px;
    }

    .benefit-icon i {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .slideshow-container {
        height: 250px;
    }

    .benefit-title {
        font-size: 1.5rem;
    }

    .benefit-description {
        font-size: 1rem;
    }

    .benefit-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .benefit-icon i {
        font-size: 1.75rem;
    }

    .slide-nav {
        width: 40px;
        height: 40px;
    }

    .slide-nav.prev {
        left: 15px;
    }

    .slide-nav.next {
        right: 15px;
    }

    .slide-nav i {
        font-size: 1rem;
    }

    .slideshow-dots {
        bottom: 20px;
        gap: 8px;
    }

    .dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 576px) {
    .slideshow-container {
        height: 220px;
    }

    .benefit-title {
        font-size: 1.25rem;
    }

    .benefit-description {
        font-size: 0.9rem;
    }

    .slide-content {
        padding: 1rem;
    }
}

/* ============================================
   Client-Side Job Filtering Transitions
   ============================================ */

.jobs-grid .row > article {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.jobs-grid .row > article[style*="display: none"] {
    opacity: 0;
    transform: translateY(10px);
}

.active-filters .filter-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.active-filters .filter-remove:hover {
    opacity: 1;
}

/* ============================================
   Why Work at APS Section Styles
   ============================================ */

.jobs-cta-section .cta-description {
    max-width: 100%;
    text-align: left;
}
