/*
 * Responsive CSS for Job Search Interface
 * Career Search Theme
 */

/* Mobile-first responsive design */

/* Extra Small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    .job-search-container {
        margin: 1rem 0;
        padding: 1rem;
    }

    .search-filters {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .filter-group label {
        font-size: 0.9rem;
    }

    .filter-group select,
    .filter-group input {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .job-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .job-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .job-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .job-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .job-actions .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination a,
    .pagination span {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Fix for checkbox text wrapping on mobile */
    .checkbox-item {
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .checkmark {
        margin-top: 0.15rem;
    }

    .checkbox-text {
        font-size: 0.9rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .search-filters {
        grid-template-columns: repeat(2, 1fr);
    }

    .job-meta {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .job-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .careersearch-job-listing .columns-2 .job-grid,
    .careersearch-job-listing .columns-3 .job-grid,
    .careersearch-job-listing .columns-4 .job-grid {
        grid-template-columns: 1fr;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 750px;
    }

    .search-filters {
        grid-template-columns: repeat(3, 1fr);
    }

    .job-item {
        padding: 1.25rem;
    }

    .job-title {
        font-size: 1.2rem;
    }

    .careersearch-job-listing .columns-3 .job-grid,
    .careersearch-job-listing .columns-4 .job-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Single job page adjustments */
    .job-content-wrapper {
        grid-template-columns: 1fr 250px;
        gap: 2rem;
    }

    .job-sidebar .job-meta-card,
    .job-sidebar .contact-card,
    .job-sidebar .quick-actions-card {
        padding: 1.25rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }

    .search-filters {
        grid-template-columns: repeat(4, 1fr);
    }

    .careersearch-job-listing .columns-4 .job-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .search-filters {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* XXL devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .job-item {
        transition: none;
    }

    .job-item:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .btn {
        min-height: 44px; /* Minimum touch target size */
        padding: 0.75rem 1rem;
    }

    .filter-group select,
    .filter-group input {
        min-height: 44px;
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .site-logo {
        /* Use high-res logo if available */
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .job-search-container,
    .pagination,
    .job-actions,
    .quick-actions-card {
        display: none !important;
    }

    .job-content-wrapper {
        grid-template-columns: 1fr;
    }

    .job-content,
    .job-sidebar .job-meta-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }

    .job-title {
        font-size: 18pt;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .job-item {
        transform: none !important;
    }

    .spinner {
        animation: none;
        border: 3px solid #8c1515;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --border-color: #444;
        --card-bg: #2d2d2d;
    }

    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }

    .job-search-container,
    .job-item,
    .job-content,
    .job-meta-card,
    .contact-card,
    .quick-actions-card {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }

    .filter-group select,
    .filter-group input {
        background-color: var(--card-bg);
        border-color: var(--border-color);
        color: var(--text-color);
    }
}

/* Landscape orientation for mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
    .job-search-container {
        padding: 1rem;
    }

    .search-filters {
        grid-template-columns: repeat(2, 1fr);
    }

    .job-item {
        padding: 1rem;
    }
}

/* Very wide screens (ultra-wide monitors) */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }

    .search-filters {
        grid-template-columns: repeat(5, 1fr);
    }

    .job-content-wrapper {
        grid-template-columns: 1fr 350px;
    }
}

/* Focus states for better accessibility */
.filter-group select:focus,
.filter-group input:focus,
.btn:focus,
.job-title:focus,
.pagination a:focus {
    outline: 2px solid #8c1515;
    outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999999;
    padding: 8px 16px;
    background: #8c1515;
    color: white;
    text-decoration: none;
    transition: left 0.3s;
}

.skip-link:focus {
    left: 6px;
    top: 7px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-info {
    background: #17a2b8;
}

.notification-warning {
    background: #ffc107;
    color: #212529;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Flexible video embeds */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Utility classes for responsive design */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
    .d-sm-grid { display: grid !important; }
}

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-grid { display: grid !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
    .d-lg-grid { display: grid !important; }
}

@media (min-width: 1200px) {
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
    .d-xl-flex { display: flex !important; }
    .d-xl-grid { display: grid !important; }
}

/* Text alignment utilities */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

@media (min-width: 576px) {
    .text-sm-left { text-align: left !important; }
    .text-sm-center { text-align: center !important; }
    .text-sm-right { text-align: right !important; }
}

@media (min-width: 768px) {
    .text-md-left { text-align: left !important; }
    .text-md-center { text-align: center !important; }
    .text-md-right { text-align: right !important; }
}

* assets/css/careersearch-admin.css */
.smart-select-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.smart-select-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.smart-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.smart-select-option {
    padding: 8px;
    cursor: pointer;
}

.smart-select-option:hover {
    background: #f0f0f0;
}

.smart-select-loading,
.smart-select-no-results,
.smart-select-error {
    padding: 8px;
    color: #666;
    font-size: 14px;
}

.smart-select-error {
    color: #d00;
}