/* RSS Manager Styles */
/* Extracted from RssManager.razor for better maintainability */

/* Container principal */
.test-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Sections génériques */
.input-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.status-section {
    background: white;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.preview-section {
    background: white;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mapping-section {
    background: white;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.source-content-section {
    background: white;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Status items */
.status-item {
    padding: 10px;
    margin: 5px 0;
    border-left: 4px solid #dee2e6;
    background: #f8f9fa;
}

.status-success {
    border-left-color: #28a745;
    background: #d4edda;
}

.status-error {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.status-pending {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.status-info {
    border-left-color: #17a2b8;
    background: #d1ecf1;
}

/* Debug section */
.debug-info {
    background: #f1f3f4;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

/* Collapsible headers */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapsible-header i.bi-chevron-right,
.collapsible-header i.bi-chevron-down {
    transition: transform 0.2s;
    font-size: 0.9em;
}

/* XML/JSON structure display */
.xml-structure {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9em;
}

/* Field items */
.field-item {
    padding: 8px;
    margin: 5px 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.field-item:hover {
    background: #e9ecef;
}

.field-item.selected {
    background: #d1ecf1;
    border-color: #bee5eb;
}

/* Source viewer */
.source-viewer {
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.85em;
    font-family: 'Courier New', Courier, monospace;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    border: 1px solid #dee2e6;
}

.source-content {
    overflow-x: auto;
    max-width: 100%;
}

/* Mapping table */
.mapping-table {
    width: 100%;
    margin-top: 20px;
}

.mapping-table th {
    background: #f8f9fa;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.mapping-table td {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
}

.mapping-select {
    width: 100%;
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.field-sample {
    display: block;
    color: #6c757d;
    font-size: 0.85em;
    font-style: italic;
    margin-top: 4px;
}

/* Buttons */
.btn-group-vertical .btn {
    text-align: left;
}

/* Alerts */
.alert-dismissible {
    position: relative;
    padding-right: 4rem;
}

/* Loading states */
.loading-overlay {
    position: relative;
    min-height: 100px;
}

.loading-overlay.is-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: 1000;
}

/* Copy button feedback */
.copy-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 2000;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .test-container {
        padding: 10px;
    }
    
    .input-section,
    .status-section,
    .preview-section,
    .mapping-section,
    .source-content-section {
        padding: 15px;
        border-radius: 5px;
        margin-bottom: 15px;
    }
    
    .mapping-table {
        font-size: 0.9em;
    }
    
    .field-item {
        padding: 10px;
        font-size: 0.95em;
    }
    
    .source-viewer {
        font-size: 0.8em;
        max-height: 300px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .field-item,
    .collapsible-header,
    button {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .field-item {
        padding: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .input-section {
        background: #212529;
        color: #f8f9fa;
    }
    
    .status-section,
    .preview-section,
    .mapping-section,
    .source-content-section {
        background: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .field-item {
        background: #212529;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .field-item:hover {
        background: #495057;
    }
    
    .xml-structure,
    .source-viewer {
        background: #212529;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .mapping-table th {
        background: #212529;
        color: #f8f9fa;
    }
    
    .mapping-table td {
        border-color: #495057;
        color: #f8f9fa;
    }
}