/* Modale d'actions pour les cibles */

/* Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

/* Contenu de la modale */
.target-actions-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header de la modale */
.target-actions-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.target-actions-modal .target-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.target-actions-modal .target-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.9rem;
}

.target-actions-modal .target-id,
.target-actions-modal .target-ip,
.target-actions-modal .target-mac {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.target-actions-modal .target-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.target-status-badge.online {
    background: #28a745;
    color: white;
}

.target-status-badge.offline {
    background: #dc3545;
    color: white;
}

.target-status-badge.maintenance,
.target-status-badge.unusable {
    background: #ffc107;
    color: #212529;
}

.target-status-badge.unknown {
    background: #6c757d;
    color: white;
}

.target-actions-modal .modal-close {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.target-actions-modal .modal-close:hover {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Body de la modale */
.target-actions-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Grille de boutons d'action */
.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.action-buttons-grid .btn {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.action-buttons-grid .btn i {
    font-size: 1.1rem;
}

.action-buttons-grid .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-buttons-grid .btn:active {
    transform: translateY(0);
}

/* Zone de résultats */
.modal-results {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.modal-results .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #dee2e6;
}

.modal-results .results-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #495057;
}

.modal-results .btn-clear-results {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-results .btn-clear-results:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #212529;
}

.modal-results .results-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #212529;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
}

/* Panel détails riche (HTML) */
.modal-results .results-content.html-panel {
    white-space: normal;
    font-family: inherit;
}

.details-section {
    margin-bottom: 0.85rem;
}

.details-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #dee2e6;
}

.details-counters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
}

.details-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.3rem 0.2rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    text-align: center;
}

.details-counter.dc-total  { border-color: #3b82f6; background: #eff6ff; }
.details-counter.dc-lifetime { border-color: #7c3aed; background: #f5f3ff; }

.dc-label {
    font-size: 0.65rem;
    color: #6c757d;
    margin-bottom: 0.1rem;
}

.dc-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #212529;
    font-variant-numeric: tabular-nums;
}

.details-dates-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.details-date-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.82rem;
    padding: 0.15rem 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 0.5rem;
}

.dd-label {
    color: #6c757d;
    flex-shrink: 0;
}

.dd-val {
    color: #212529;
    font-weight: 500;
    text-align: right;
}

.modal-results .results-content.success {
    color: #28a745;
}

.modal-results .results-content.error {
    color: #dc3545;
}

.modal-results .results-content.info {
    color: #17a2b8;
}

/* Dark mode */
body.dark-mode .target-actions-modal {
    background: #1e293b;
    color: #e2e8f0;
}

body.dark-mode .target-actions-modal .modal-body {
    background: #1e293b;
}

body.dark-mode .modal-results,
body.dark-mode #modal-results {
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .modal-results .results-header,
body.dark-mode #modal-results .results-header {
    border-color: #334155;
}

body.dark-mode .modal-results .results-header h4,
body.dark-mode #modal-results .results-header h4 {
    color: #94a3b8;
}

body.dark-mode .modal-results .results-content,
body.dark-mode #modal-results .results-content {
    background: transparent !important;
    color: #e2e8f0 !important;
}

body.dark-mode #modal-results .results-content.success {
    color: #4ade80 !important;
    background: transparent !important;
}

body.dark-mode #modal-results .results-content.error {
    color: #f87171 !important;
    background: transparent !important;
}

body.dark-mode #modal-results .results-content.info {
    color: #67e8f9 !important;
    background: transparent !important;
}

body.dark-mode .details-section-title {
    color: #94a3b8;
    border-color: #334155;
}

body.dark-mode .details-counter {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .details-counter.dc-total {
    background: #1e3a5f;
    border-color: #3b82f6;
}

body.dark-mode .details-counter.dc-lifetime {
    background: #2d1b5e;
    border-color: #7c3aed;
}

body.dark-mode .dc-label {
    color: #94a3b8;
}

body.dark-mode .dc-val {
    color: #f1f5f9;
}

body.dark-mode .details-date-row {
    border-color: #1e293b;
}

body.dark-mode .dd-label {
    color: #94a3b8;
}

body.dark-mode .dd-val {
    color: #e2e8f0;
}

/* Responsive */
@media (max-width: 768px) {
    .target-actions-modal {
        width: 95%;
        max-width: none;
    }
    
    .action-buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .target-actions-modal .modal-header {
        padding: 1rem;
    }
    
    .target-actions-modal .target-info h3 {
        font-size: 1.25rem;
    }
    
    .target-actions-modal .modal-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .target-actions-modal .target-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
