/* GuardSync Security Components - Interface agents de sécurité */

/* === PATROL INTERFACE COMPONENTS === */
.patrol-controls {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--security-primary) 0%, #1e3a8a 100%);
    padding: 1rem;
    border-radius: 0 0 1rem 1rem;
    color: white;
    box-shadow: 0 4px 20px rgba(30,64,175,0.3);
}

.patrol-timer {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.patrol-timer .time-display {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251,191,36,0.3);
}

.checkpoint-card {
    border: 3px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.checkpoint-card.completed {
    border-color: var(--patrol-active);
    background: rgba(16,185,129,0.05);
    transform: scale(0.98);
}

.checkpoint-card.current {
    border-color: var(--checkpoint-ok);
    box-shadow: 0 0 20px rgba(99,102,241,0.2);
    transform: translateY(-2px);
}

.checkpoint-card.pending {
    border-color: #d1d5db;
    opacity: 0.7;
}

.checkpoint-status {
    position: absolute;
    top: -10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
}

.checkpoint-status.completed {
    background: var(--patrol-active);
}

.checkpoint-status.current {
    background: var(--checkpoint-ok);
    animation: pulse-checkpoint 2s infinite;
}

.checkpoint-status.pending {
    background: #9ca3af;
}

@keyframes pulse-checkpoint {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* === QR CODE SCANNER === */
.qr-scanner-container {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    background: #1f2937;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.qr-scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid transparent;
    border-image: linear-gradient(45deg, var(--security-primary), var(--patrol-active)) 1;
    pointer-events: none;
}

.qr-scanner-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 2px solid var(--patrol-active);
    border-radius: 1rem;
    transform: translate(-50%, -50%);
    animation: scan-border 2s ease-in-out infinite;
}

@keyframes scan-border {
    0%, 100% { border-color: var(--patrol-active); }
    50% { border-color: var(--security-warning); }
}

.qr-scan-result {
    background: linear-gradient(135deg, var(--patrol-active) 0%, #059669 100%);
    color: white;
    padding: 1rem;
    border-radius: 1rem;
    text-align: center;
    margin-top: 1rem;
    animation: scan-success 0.5s ease;
}

@keyframes scan-success {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* === EMERGENCY INTERFACE === */
.emergency-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(239,68,68,0.95);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.emergency-panel {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: emergency-appear 0.3s ease;
}

@keyframes emergency-appear {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.emergency-icon {
    font-size: 4rem;
    color: var(--alert-urgent);
    margin-bottom: 1rem;
    animation: urgent-pulse 1s infinite;
}

@keyframes urgent-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === SHIFT STATUS INDICATORS === */
.shift-status-bar {
    position: sticky;
    top: 0;
    z-index: 99;
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shift-status-bar.active {
    background: linear-gradient(90deg, var(--patrol-active) 0%, #10b981 100%);
    color: white;
}

.shift-status-bar.break {
    background: linear-gradient(90deg, var(--security-warning) 0%, #d97706 100%);
    color: white;
}

.shift-status-bar.ended {
    background: linear-gradient(90deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

/* === REPORT FORMS === */
.security-form {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.form-section {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    color: var(--security-primary);
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.priority-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.priority-option {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.priority-option.low {
    border-color: #10b981;
    color: #059669;
}

.priority-option.medium {
    border-color: #f59e0b;
    color: #d97706;
}

.priority-option.high {
    border-color: #ef4444;
    color: #dc2626;
}

.priority-option.selected {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.priority-option.low.selected {
    background: rgba(16,185,129,0.1);
}

.priority-option.medium.selected {
    background: rgba(245,158,11,0.1);
}

.priority-option.high.selected {
    background: rgba(239,68,68,0.1);
}

/* === HANDOVER INTERFACE === */
.handover-chain {
    position: relative;
    padding: 1rem 0;
}

.handover-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.handover-item::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    width: 20px;
    height: 4px;
    background: var(--security-primary);
    border-radius: 2px;
    transform: translateY(-50%);
}

.handover-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--security-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1rem;
}

.handover-content {
    flex: 1;
}

.handover-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.handover-status {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.handover-status.pending {
    background: rgba(245,158,11,0.1);
    color: #d97706;
}

.handover-status.acknowledged {
    background: rgba(16,185,129,0.1);
    color: #059669;
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 768px) {
    .patrol-controls {
        margin: -1rem -1rem 1rem -1rem;
        border-radius: 0 0 1rem 1rem;
    }
    
    .checkpoint-card {
        margin-bottom: 0.75rem;
        padding: 1rem;
    }
    
    .qr-scanner-container {
        max-width: 250px;
    }
    
    .priority-selector {
        grid-template-columns: 1fr;
    }
    
    .handover-item {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }
    
    .handover-avatar {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }
}

/* === ACCESSIBILITY FEATURES === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .checkpoint-card,
    .security-form,
    .handover-item {
        border-width: 3px;
    }
    
    .priority-option {
        border-width: 3px;
    }
}

/* === PRINT STYLES === */
@media print {
    .patrol-controls,
    .emergency-btn,
    .qr-scanner-container {
        display: none !important;
    }
    
    .checkpoint-card,
    .security-form,
    .handover-item {
        break-inside: avoid;
        box-shadow: none !important;
        border: 2px solid #000 !important;
    }
}