/**
 * Enhanced Job Details - Base CSS
 * Module-specific styles with ejd- prefix
 * Uses Gestalt design system variables for theming
 */

/* Import Gestalt variables for consistent design tokens */
@import '/gestalt-variables.css';

/* Module-specific variables */
:root {
    --ejd-debug-color: rgba(0, 255, 0, 0.1);
    --ejd-seo-indicator: var(--color-success);
}

/* SEO Debug Indicators (development only) */
.ejd-seo-debug {
    display: none; /* Hidden by default */
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--color-success);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    z-index: var(--z-tooltip);
    font-family: monospace;
}

.ejd-seo-debug.active {
    display: block;
}

.ejd-enhanced-schema {
    /* Visual indicator for enhanced schema (development) */
    position: relative;
}

.ejd-enhanced-schema::before {
    content: '\2713 SEO Enhanced';
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--ejd-seo-indicator);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    display: none; /* Only show in debug mode */
    z-index: 100;
}

/* Debug mode styles */
body.ejd-debug-mode .ejd-enhanced-schema::before {
    display: block;
}

body.ejd-debug-mode .ejd-seo-debug {
    display: block;
}

/* Enhanced meta tag indicators (debug only) */
.ejd-meta-enhanced {
    border: 2px solid var(--ejd-seo-indicator) !important;
    box-shadow: 0 0 5px rgba(var(--color-success-rgb, 40, 167, 69), 0.3) !important;
}

/* Smooth transitions for enhanced elements */
.ejd-enhanced {
    transition: all 0.3s ease;
}

/* Social sharing enhancements */
.ejd-social-enhanced {
    position: relative;
}

.ejd-social-enhanced::after {
    content: 'Enhanced for Social';
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: var(--font-xs);
    color: var(--color-text-secondary);
    display: none;
}

body.ejd-debug-mode .ejd-social-enhanced::after {
    display: block;
}

/* Schema markup indicators */
.ejd-schema-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--color-info);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    z-index: var(--z-tooltip);
    display: none;
    max-width: 300px;
}

.ejd-schema-indicator.show {
    display: block;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Performance optimizations */
.ejd-optimized {
    /* Enhanced loading states */
    will-change: opacity, transform;
}

.ejd-lazy-load {
    /* Lazy loading placeholder */
    background: linear-gradient(90deg,
        var(--color-bg-subtle, #f8f9fa) 25%,
        var(--color-border, #dee2e6) 50%,
        var(--color-bg-subtle, #f8f9fa) 75%
    );
    background-size: 200% 100%;
    animation: ejd-skeleton-loading 1.5s infinite;
}

@keyframes ejd-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced error states */
.ejd-error-enhanced {
    border-left: 4px solid var(--color-danger);
    background: rgba(var(--color-danger-rgb, 220, 53, 69), 0.05);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    border-radius: var(--radius-sm);
}

.ejd-error-enhanced .ejd-error-title {
    color: var(--color-danger);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-sm);
}

.ejd-error-enhanced .ejd-error-message {
    color: var(--color-text);
    font-size: var(--font-sm);
}

/* Enhanced success states */
.ejd-success-enhanced {
    border-left: 4px solid var(--color-success);
    background: rgba(var(--color-success-rgb, 40, 167, 69), 0.05);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    border-radius: var(--radius-sm);
}

.ejd-success-enhanced .ejd-success-title {
    color: var(--color-success);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-sm);
}

/* SEO score indicator (development tool) */
.ejd-seo-score {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: white;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--elevation-2);
    display: none;
    z-index: var(--z-tooltip);
    min-width: 200px;
}

.ejd-seo-score.show {
    display: block;
}

.ejd-seo-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    font-size: var(--font-sm);
}

.ejd-seo-score-value {
    font-weight: var(--font-semibold);
}

.ejd-seo-score-value.good {
    color: var(--color-success);
}

.ejd-seo-score-value.warning {
    color: var(--color-warning);
}

.ejd-seo-score-value.error {
    color: var(--color-danger);
}

/* Enhanced breadcrumb styling */
.ejd-breadcrumb-enhanced {
    /* Subtle enhancement for breadcrumb with schema */
    position: relative;
}

.ejd-breadcrumb-enhanced::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        var(--color-primary),
        transparent
    );
}

/* Mobile enhancements */
@media (max-width: 767px) {
    .ejd-seo-debug {
        top: 10px;
        right: 10px;
        font-size: 10px;
        padding: 4px 8px;
    }

    .ejd-schema-indicator {
        bottom: 10px;
        left: 10px;
        font-size: var(--font-xs);
        padding: 6px 10px;
    }

    .ejd-seo-score {
        display: none !important; /* Too complex for mobile */
    }
}

/* Print styles (enhanced for better SEO) */
@media print {
    .ejd-seo-debug,
    .ejd-schema-indicator,
    .ejd-seo-score {
        display: none !important;
    }

    .ejd-enhanced-schema::before {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ejd-seo-debug {
        border: 2px solid;
    }

    .ejd-enhanced-schema::before {
        border: 1px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ejd-enhanced,
    .ejd-schema-indicator {
        animation: none !important;
        transition: none !important;
    }

    .ejd-lazy-load {
        animation: none !important;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    :root {
        --ejd-debug-color: rgba(0, 255, 0, 0.2);
    }

    .ejd-seo-score {
        background: var(--color-text, #212529);
        border-color: var(--color-text-muted, #6c757d);
        color: white;
    }
}

/* Focus enhancement for accessibility */
.ejd-enhanced:focus-within {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Enhanced keyboard navigation */
.ejd-keyboard-enhanced {
    position: relative;
}

.ejd-keyboard-enhanced:focus {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.3);
    border-radius: var(--radius-sm);
}

/* Loading state enhancements */
.ejd-loading {
    position: relative;
    pointer-events: none;
}

.ejd-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Enhanced form validation styling */
.ejd-form-enhanced .form-control:valid {
    border-color: var(--color-success);
}

.ejd-form-enhanced .form-control:invalid {
    border-color: var(--color-danger);
}

/* Enhanced button states */
.ejd-btn-enhanced {
    position: relative;
    overflow: hidden;
}

.ejd-btn-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.ejd-btn-enhanced:hover::before {
    width: 200px;
    height: 200px;
}

/* Utility classes for enhanced functionality */
.ejd-hidden {
    display: none !important;
}

.ejd-visible {
    display: block !important;
}

.ejd-fade-in {
    animation: fadeIn 0.3s ease;
}

.ejd-fade-out {
    animation: fadeOut 0.3s ease;
}

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

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

/* Enhanced accessibility indicators */
.ejd-screen-reader-only {
    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;
}

/* Enhanced content indicators */
.ejd-content-enhanced {
    /* Subtle indicator that content has been enhanced */
    position: relative;
}

/* Development mode grid overlay */
body.ejd-debug-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 255, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 0, 0.1) 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
    z-index: 9999;
    display: none; /* Only show when specifically requested */
}

body.ejd-debug-mode.ejd-show-grid::before {
    display: block;
}

/* Salary Histogram Widget Styles */
.ejd-histogram-widget .ejd-salary-summary {
    background: var(--color-bg-subtle, #f8f9fa);
    border-radius: var(--radius-md, 8px);
    padding: var(--space-md, 15px);
    margin-bottom: var(--space-md, 15px);
    border: 1px solid var(--color-border, #e9ecef);
}

.ejd-histogram-widget .ejd-salary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ejd-histogram-widget .ejd-salary-stat-value {
    font-size: 1.2rem;
    font-weight: var(--font-semibold, 600);
    color: var(--color-primary-dark, #285f8f);
}

.ejd-histogram-widget .ejd-salary-stat-label {
    font-size: var(--font-xs, 0.8rem);
    color: var(--color-text-secondary, #6c757d);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#ejdSalaryHistogramChart {
    max-height: 250px;
    width: 100% !important;
}

.seo-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Company Link Icon Styling */
.company-link-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* Space between name and icon */
}
.company-profile-icon {
    font-size: 0.8em; /* Make icon slightly smaller than text */
    color: var(--color-primary, #3172ae);
    opacity: 0.6;
    transition: opacity 0.2s ease-in-out;
}
.company-link-with-icon:hover .company-profile-icon {
    opacity: 1;
}
