/**
 * Salary Explorer Block - Frontend Styles
 * 
 * @package LSG\Blocks
 * @since 1.0.0
 */

.lsg-salary-explorer-block {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.lsg-explorer-title {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* Explorer Controls */
.lsg-explorer-controls {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.lsg-explorer-controls .components-flex {
    gap: 15px;
    margin-bottom: 15px;
}

.lsg-explorer-controls .components-flex > * {
    flex: 1;
    min-width: 200px;
}

.lsg-explorer-controls label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.lsg-explorer-controls input,
.lsg-explorer-controls select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out;
}

.lsg-explorer-controls input:focus,
.lsg-explorer-controls select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

/* Location Selector */
.lsg-location-selector {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e5e9;
}

.lsg-location-selector .components-flex {
    gap: 10px;
    align-items: end;
}

.lsg-location-selector .components-flex > *:first-child {
    flex: 1;
}

.lsg-location-selector .components-flex > *:last-child {
    flex-shrink: 0;
}

/* Location Chips */
.lsg-location-chips {
    margin-top: 15px;
}

.lsg-location-chips p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.lsg-location-chips .components-flex {
    gap: 8px;
    flex-wrap: wrap;
}

.components-chip {
    display: inline-flex;
    align-items: center;
    background: #667eea;
    color: #fff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.components-chip:hover {
    background: #5a67d8;
}

.components-chip .components-chip__remove {
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: #fff;
}

.components-chip .components-chip__remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Chart Container */
.lsg-chart-container {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.lsg-chart-container canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Data Table */
.lsg-data-table {
    margin-top: 20px;
}

.lsg-data-table h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.lsg-table-container {
    overflow-x: auto;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    max-width: 100%;
}

.lsg-salary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}

.lsg-salary-table th,
.lsg-salary-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.lsg-salary-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.lsg-salary-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.lsg-salary-table tbody tr:last-child td {
    border-bottom: none;
}

/* Salary values styling */
.lsg-salary-table td:nth-child(n+3) {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 500;
}

/* Loading and Error States */
.lsg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.lsg-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: lsg-spin 1s linear infinite;
}

@keyframes lsg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lsg-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin: 20px 0;
}

.lsg-no-data {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin: 20px 0;
}

/* Download Button */
.lsg-download-btn {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    margin-top: 15px;
}

.lsg-download-btn:hover {
    background: #218838;
}

.lsg-download-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .lsg-salary-explorer-block {
        padding: 15px;
        margin: 15px 0;
    }
    
    .lsg-explorer-title {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .lsg-explorer-controls {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .lsg-explorer-controls .components-flex {
        flex-direction: column;
        gap: 10px;
    }
    
    .lsg-explorer-controls .components-flex > * {
        min-width: auto;
    }
    
    .lsg-location-selector .components-flex {
        flex-direction: column;
        gap: 10px;
    }
    
    .lsg-location-selector .components-flex > *:last-child {
        align-self: stretch;
    }
    
    .lsg-chart-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .lsg-salary-table {
        font-size: 13px;
        min-width: 500px;
    }
    
    .lsg-salary-table th,
    .lsg-salary-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .lsg-salary-explorer-block {
        padding: 10px;
        margin: 10px 0;
    }
    
    .lsg-explorer-title {
        font-size: 1.2em;
        margin-bottom: 10px;
    }
    
    .lsg-explorer-controls {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .lsg-chart-container {
        padding: 10px;
        margin: 10px 0;
    }
    
    .lsg-salary-table {
        font-size: 12px;
        min-width: 400px;
    }
    
    .lsg-salary-table th,
    .lsg-salary-table td {
        padding: 6px 8px;
    }
    
    .lsg-salary-table th {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .lsg-salary-table {
        min-width: 350px;
        font-size: 11px;
    }
    
    .lsg-salary-table th,
    .lsg-salary-table td {
        padding: 4px 6px;
    }
    
    .lsg-salary-table th {
        font-size: 10px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .lsg-salary-explorer-block {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .lsg-explorer-title {
        color: #e2e8f0;
    }
    
    .lsg-explorer-controls {
        background: #4a5568;
        border-color: #718096;
    }
    
    .lsg-explorer-controls label {
        color: #e2e8f0;
    }
    
    .lsg-explorer-controls input,
    .lsg-explorer-controls select {
        background: #2d3748;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .lsg-explorer-controls input:focus,
    .lsg-explorer-controls select:focus {
        border-color: #4c51bf;
        box-shadow: 0 0 0 2px rgba(76, 81, 191, 0.25);
    }
    
    .lsg-location-chips p {
        color: #e2e8f0;
    }
    
    .lsg-chart-container {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .lsg-data-table h4 {
        color: #e2e8f0;
    }
    
    .lsg-salary-table th {
        background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
    }
    
    .lsg-salary-table th,
    .lsg-salary-table td {
        border-bottom-color: #718096;
    }
    
    .lsg-salary-table tbody tr:hover {
        background-color: #4a5568;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .lsg-salary-explorer-block {
        border: 2px solid #000;
    }
    
    .lsg-explorer-controls {
        border: 2px solid #000;
    }
    
    .lsg-chart-container {
        border: 2px solid #000;
    }
    
    .lsg-salary-table {
        border: 2px solid #000;
    }
    
    .lsg-salary-table th {
        background: #000 !important;
        color: #fff !important;
    }
    
    .lsg-salary-table td {
        border-bottom: 1px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .lsg-salary-table tbody tr:hover {
        transition: none;
    }
    
    .lsg-loading::before {
        animation: none;
    }
    
    .lsg-explorer-controls input,
    .lsg-explorer-controls select,
    .lsg-download-btn {
        transition: none;
    }
}
