/* Loxo Integration Frontend Styles */

.loxo-job-list {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.loxo-job-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.loxo-job-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.loxo-job-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #333;
}

.loxo-job-title a {
    color: #0073aa;
    text-decoration: none;
}

.loxo-job-title a:hover {
    text-decoration: underline;
}

.loxo-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.loxo-job-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.loxo-job-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.loxo-job-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.loxo-job-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.loxo-job-apply-btn {
    background: #0073aa;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.loxo-job-apply-btn:hover {
    background: #005a87;
    color: #fff;
}

.loxo-job-date {
    font-size: 13px;
    color: #888;
}

/* Job Filters */
.loxo-job-filters {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.loxo-job-filters h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.loxo-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.loxo-filter-group {
    flex: 1;
    min-width: 200px;
}

.loxo-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.loxo-filter-group select,
.loxo-filter-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.loxo-filter-submit {
    background: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.loxo-filter-submit:hover {
    background: #005a87;
}

/* Job Detail Page */
.loxo-job-detail {
    max-width: 800px;
    margin: 0 auto;
}

.loxo-job-header {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.loxo-job-header h1 {
    margin: 0 0 10px 0;
    color: #333;
}

.loxo-job-header .job-company {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.loxo-job-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.loxo-job-detail-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
}

.loxo-job-detail-item h4 {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loxo-job-detail-item .value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.loxo-job-content {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 30px;
    line-height: 1.6;
}

.loxo-job-content h2,
.loxo-job-content h3,
.loxo-job-content h4 {
    color: #333;
    margin-top: 25px;
    margin-bottom: 15px;
}

.loxo-job-content h2:first-child,
.loxo-job-content h3:first-child,
.loxo-job-content h4:first-child {
    margin-top: 0;
}

/* Job Application Form */
.loxo-application-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 30px;
}

.loxo-application-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.loxo-form-row {
    margin-bottom: 20px;
}

.loxo-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.loxo-form-row input,
.loxo-form-row textarea,
.loxo-form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.loxo-form-row textarea {
    height: 120px;
    resize: vertical;
}

.loxo-form-submit {
    background: #0073aa;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

.loxo-form-submit:hover {
    background: #005a87;
}

/* Enhanced Responsive Design */
@media (max-width: 1024px) {
    /* Tablet adjustments */
    .loxo-job-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .loxo-job-card {
        padding: 18px;
    }
    
    .loxo-job-title {
        font-size: 18px;
    }
    
    .loxo-filter-row {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    /* Mobile optimizations */
    .loxo-job-list {
        gap: 12px;
        margin: 15px 0;
    }
    
    .loxo-job-card {
        padding: 16px;
        border-radius: 6px;
    }
    
    .loxo-job-title {
        font-size: 35px !important;
        line-height: 1.4;
    }
    
    .loxo-job-meta {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .loxo-job-meta-item {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .loxo-job-meta-item .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
    
    .loxo-job-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        align-items: center;
    }
    
    .loxo-job-apply-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Filters responsive design */
    .loxo-job-filters {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .loxo-filter-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .loxo-filter-group {
        min-width: auto;
    }
    
    .loxo-filter-group select,
    .loxo-filter-group input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .loxo-filter-submit {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* Job detail page responsive */
    .loxo-job-detail {
        max-width: 100%;
        margin: 0;
        padding: 0 15px;
    }
    
    .loxo-job-header {
        padding: 20px 16px;
        text-align: left;
    }
    
    .loxo-job-header h1 {
        font-size: 24px;
        line-height: 1.3;
    }
    
    .loxo-job-header .job-company {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .loxo-job-details-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .loxo-job-detail-item {
        padding: 12px;
    }
    
    .loxo-job-detail-item h4 {
        font-size: 11px;
    }
    
    .loxo-job-detail-item .value {
        font-size: 14px;
    }
    
    .loxo-job-content {
        padding: 20px 16px;
    }
    
    .loxo-job-content h2,
    .loxo-job-content h3,
    .loxo-job-content h4 {
        font-size: 18px;
        margin-top: 20px;
        margin-bottom: 12px;
    }
    
    /* Application form responsive */
    .loxo-application-form {
        padding: 20px;
        margin-top: 20px;
    }
    
    .loxo-form-row input,
    .loxo-form-row textarea,
    .loxo-form-row select {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .loxo-form-submit {
        width: 100%;
        padding: 14px 24px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    /* Small mobile optimizations */
    .loxo-job-card {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .loxo-job-title {
        font-size: 35px !important;
        margin-bottom: 8px;
    }
    
    .loxo-job-meta {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .loxo-job-meta-item {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .loxo-job-excerpt {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 12px;
    }
    
    .loxo-job-filters {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .loxo-job-filters h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .loxo-filter-row {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .loxo-job-header {
        padding: 16px 12px;
    }
    
    .loxo-job-header h1 {
        font-size: 20px;
    }
    
    .loxo-job-header .job-company {
        font-size: 14px;
    }
    
    .loxo-job-content {
        padding: 16px 12px;
    }
    
    .loxo-application-form {
        padding: 16px;
    }
    
    /* Touch-friendly button sizing */
    .loxo-job-apply-btn,
    .loxo-filter-submit,
    .loxo-form-submit {
        min-height: 44px; /* iOS recommended minimum touch target */
    }
}

@media (max-width: 320px) {
    /* Very small screens */
    .loxo-job-card {
        padding: 12px;
    }
    
    .loxo-job-title {
        font-size: 35px !important;
    }
    
    .loxo-job-filters {
        padding: 10px;
    }
    
    .loxo-job-header {
        padding: 12px 10px;
    }
    
    .loxo-job-content {
        padding: 12px 10px;
    }
}

/* Loading States */
.loxo-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loxo-loading:before {
    content: "";
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: loxo-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes loxo-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.loxo-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
}

.loxo-success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
}

/* Remove padding from job details */
.loxo-job-details {
    padding: 0 !important;
}

.loxo-spa-detail-content {
    padding: 0 !important;
}

.loxo-job-detail-container {
    padding: 0 !important;
}

/* Job Action Buttons Layout */
.loxo-job-action-buttons {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
}

.loxo-share-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100%;
    align-self: stretch;
}

/* Share button styling */
.loxo-share-job.loxo-btn-secondary {
    flex: 1;
    font-size: 16px;
    min-height: 48px;
}

/* Inline Share Buttons */
.loxo-job-share-buttons {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}

.loxo-share-buttons-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.loxo-inline-share-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #666;
}

.loxo-inline-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
}

/* Platform-specific colors for inline buttons */
.loxo-inline-share-btn[data-platform="facebook"]:hover {
    background-color: #1877f2;
    border-color: #1877f2;
}

.loxo-inline-share-btn[data-platform="linkedin"]:hover {
    background-color: #0a66c2;
    border-color: #0a66c2;
}

.loxo-inline-share-btn[data-platform="twitter"]:hover {
    background-color: #1da1f2;
    border-color: #1da1f2;
}

.loxo-inline-share-btn[data-platform="whatsapp"]:hover {
    background-color: #25d366;
    border-color: #25d366;
}

.loxo-inline-share-btn[data-platform="email"]:hover {
    background-color: #666;
    border-color: #666;
}

.loxo-inline-share-btn[data-platform="copy"]:hover {
    background-color: #333;
    border-color: #333;
}

/* Copy tooltip */
.loxo-copy-tooltip {
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: none;
    pointer-events: none;
}

.loxo-copy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Responsive adjustments for share buttons */
@media (max-width: 768px) {
    .loxo-job-action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .loxo-share-buttons-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .loxo-inline-share-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Legacy share styles for backward compatibility */
.loxo-share-link-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.loxo-share-link-container input {
    flex: 1;
    font-family: monospace;
    font-size: 12px;
}

#loxo-copy-link-btn {
    white-space: nowrap;
}

/* Enhanced Loading States */
.loxo-skeleton-container {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.loxo-job-skeleton {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    overflow: hidden;
}

.skeleton-header,
.skeleton-body,
.skeleton-footer {
    margin-bottom: 15px;
}

.skeleton-title,
.skeleton-company,
.skeleton-line,
.skeleton-tag {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 70%;
}

.skeleton-company {
    width: 40%;
}

.skeleton-line.short {
    width: 30%;
}

.skeleton-line.medium {
    width: 60%;
}

.skeleton-footer {
    display: flex;
    gap: 10px;
}

.skeleton-tag {
    width: 80px;
    height: 24px;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Enhanced Button Loading States */
.loxo-form-submit.loading,
.loxo-btn.loading {
    position: relative;
    color: transparent !important;
}

.loxo-form-submit.loading::after,
.loxo-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Notifications */
.loxo-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.loxo-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    background: #fff;
    border-left: 4px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.loxo-notification-success .notification-content {
    border-left-color: #46b450;
}

.loxo-notification-error .notification-content {
    border-left-color: #dc3232;
}

.loxo-notification-info .notification-content {
    border-left-color: #00a0d2;
}

.loxo-notification-warning .notification-content {
    border-left-color: #ffb900;
}

.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #333;
}

/* Enhanced Error States */
.loxo-error-container {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loxo-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.loxo-error-message {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.loxo-retry-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.loxo-retry-btn:hover {
    background: #005a87;
}

/* Form Validation Styles */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #dc3232;
    box-shadow: 0 0 0 1px rgba(220, 50, 50, 0.2);
}

.invalid {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 1px rgba(220, 50, 50, 0.2) !important;
}

/* Upload Progress */
.upload-progress {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    height: 20px;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(90deg, #46b450, #5cbf60);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* Enhanced Animations */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Accessibility Improvements */
.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;
}

/* Focus states for better accessibility */
.loxo-btn:focus,
.loxo-form-submit:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .loxo-job-card {
        border-width: 2px;
    }
    
    .loxo-btn,
    .loxo-form-submit {
        border: 2px solid currentColor;
    }
}

/* 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;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .loxo-job-card {
        background: #1e1e1e;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .loxo-job-title a {
        color: #4a9eff;
    }
    
    .notification-content {
        background: #1e1e1e;
        color: #e0e0e0;
    }
}

/* Remote tag styling */
.loxo-job-meta-tag.remote {
    background: #9b59b6 !important;
    color: white !important;
    border: none !important;
}

.loxo-job-meta-tag.remote:hover {
    background: #8e44ad !important;
}

/* Touch device optimizations */
.loxo-touch-device .loxo-job-card {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.loxo-touch-active {
    background-color: #f8f9fa !important;
    transform: scale(0.98);
    transition: all 0.1s ease;
}

.loxo-btn-pressed {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Modal body scroll lock */
.loxo-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Mobile-specific card animations */
@media (max-width: 768px) {
    .loxo-card-visible {
        animation: fadeInUp 0.3s ease-out;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* iOS safe area support */
@supports (padding: max(0px)) {
    .loxo-safe-area {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .loxo-modal-content {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}
