/**
 * Konferenz Real-Time Status Styles
 * Automatically integrates with Eventin plugin displays
 */

/* Ensure Eventin elements have proper positioning for overlays */
.etn-speaker-item,
.etn-speaker-card,
.etn-speaker-thumbnail,
.etn-single-speaker,
.eventin-speaker-wrapper,
.eventin-speaker-card,
.elementor-widget-etn-speaker .elementor-widget-container {
    position: relative !important;
}

/* Status Indicators - works on any Eventin speaker element */
.speaker-status-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
}

/* For Eventin grid layouts */
.etn-speaker-grid .speaker-status-indicator,
.etn_speakers .speaker-status-indicator {
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
}

.speaker-status-indicator i {
    font-size: 16px;
}

/* Status Colors */
.status-pending .speaker-status-indicator {
    background-color: #95a5a6;
}

.status-arrived .speaker-status-indicator {
    background-color: #3498db;
}

.status-on-stage .speaker-status-indicator,
.status-on_stage .speaker-status-indicator {
    background-color: #27ae60;
    animation: pulse 2s infinite;
}

.status-completed .speaker-status-indicator {
    background-color: #2ecc71;
}

.status-absent .speaker-status-indicator {
    background-color: #e74c3c;
}

.status-late .speaker-status-indicator {
    background-color: #e67e22;
}

/* Current Speaker Highlight */
.current-speaker {
    border: 3px solid #27ae60 !important;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.3);
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.1) 0%, transparent 100%);
}

/* Overtime Blinking */
.overtime-blink {
    background-color: rgba(231, 76, 60, 0.2) !important;
    border-color: #e74c3c !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

/* Live Status Panel */
.konferenz-live-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.konferenz-live-panel h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 24px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.live-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.status-section {
    background: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-section h4 {
    margin-top: 0;
    font-size: 18px;
    color: #34495e;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 8px;
}

.status-section.on-stage h4 {
    color: #27ae60;
}

.status-section.arrived h4 {
    color: #3498db;
}

.status-section.upcoming h4 {
    color: #95a5a6;
}

/* Speaker Cards in Live Panel */
.speaker-card {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.speaker-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.speaker-card.overtime {
    border-left-color: #e74c3c;
    animation: blink-overtime 1s infinite;
}

@keyframes blink-overtime {
    0%, 50%, 100% {
        background-color: #f8f9fa;
    }
    25%, 75% {
        background-color: rgba(231, 76, 60, 0.1);
    }
}

.speaker-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
}

.speaker-topic {
    color: #7f8c8d;
    font-size: 14px;
    margin: 5px 0;
}

.speaker-room {
    color: #95a5a6;
    font-size: 12px;
    font-style: italic;
}

.speaker-time {
    color: #3498db;
    font-size: 14px;
    font-weight: 500;
}

.overtime-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 5px;
    animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.last-update {
    text-align: center;
    color: #95a5a6;
    font-size: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

/* Room Active Indicator */
.room-active {
    position: relative;
}

.room-active::before {
    content: "LIVE";
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    animation: pulse-red 1s infinite;
}

/* Schedule Table Status Styles */
.etn-schedule-table tr.status-on-stage,
.etn-schedule-table tr.status-on_stage {
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.15) 0%, transparent 100%);
    border-left: 5px solid #27ae60;
}

.etn-schedule-table tr.overtime {
    animation: table-blink-overtime 1s infinite;
}

@keyframes table-blink-overtime {
    0%, 50%, 100% {
        background-color: transparent;
    }
    25%, 75% {
        background-color: rgba(231, 76, 60, 0.15);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .live-status-grid {
        grid-template-columns: 1fr;
    }
    
    .speaker-status-indicator {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .speaker-status-indicator i {
        font-size: 14px;
    }
}

/* Deep Integration with Eventin Elements */

/* Eventin Schedule Integration */
.etn-schedule-item,
.etn-schedule-topic,
.etn-schedule-wrap .schedule-item,
.eventin-schedule-item {
    position: relative;
}

.etn-schedule-item .speaker-status-indicator,
.etn-schedule-topic .speaker-status-indicator {
    position: static;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    border: none;
}

/* Eventin Speaker List Integration */
.etn-speaker-list .speaker-status-indicator,
.event-speaker-list .speaker-status-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
}

/* Eventin Single Speaker Page */
.single-etn-speaker .speaker-status-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 18px;
}

/* Eventin Event Page Speaker Section */
.etn-event-speaker-list .speaker-status-indicator,
.event-speaker-section .speaker-status-indicator {
    width: 25px;
    height: 25px;
    top: 8px;
    right: 8px;
}

/* Elementor Widget Compatibility */
.elementor-widget-etn-speaker .speaker-status-indicator,
.elementor-widget-etn-event .speaker-status-indicator {
    top: 15px;
    right: 15px;
}

/* Auto-injected panels positioning */
#konferenz-live-status.auto-injected {
    margin: 30px 0;
    order: -1; /* Place before main content */
}

.etn-event-content #konferenz-live-status,
.eventin-event-single #konferenz-live-status {
    margin-bottom: 40px;
}

/* Status Text Display */
.speaker-status-text {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending .speaker-status-text {
    background: #95a5a6;
    color: white;
}

.status-arrived .speaker-status-text {
    background: #3498db;
    color: white;
}

.status-on-stage .speaker-status-text,
.status-on_stage .speaker-status-text {
    background: #27ae60;
    color: white;
}

.status-completed .speaker-status-text {
    background: #2ecc71;
    color: white;
}

.status-late .speaker-status-text {
    background: #e67e22;
    color: white;
}

.status-absent .speaker-status-text {
    background: #e74c3c;
    color: white;
}

/* Enhanced Eventin Schedule Table */
.etn-schedule-table tr[data-speaker-id],
.eventin_schedule_tab_content tr[data-speaker-id] {
    transition: all 0.3s ease;
}

.etn-schedule-table tr.status-on-stage,
.eventin_schedule_tab_content tr.status-on-stage {
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.15) 0%, transparent 100%) !important;
    border-left: 5px solid #27ae60 !important;
}

/* Eventin Speaker Grid Enhancements */
.etn-speaker-grid .status-on-stage,
.etn_speakers .status-on-stage {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(39, 174, 96, 0.3);
}

/* Override Eventin's z-index if needed */
.etn-speaker-thumbnail .speaker-status-indicator,
.etn-speaker-image .speaker-status-indicator {
    z-index: 9999;
}

/* Mobile Responsive for Eventin */
@media (max-width: 768px) {
    .etn-speaker-item .speaker-status-indicator,
    .etn-speaker-card .speaker-status-indicator {
        width: 20px;
        height: 20px;
        top: 5px;
        right: 5px;
    }
    
    .single-etn-speaker .speaker-status-indicator {
        width: 30px;
        height: 30px;
        top: 10px;
        right: 10px;
    }
}

/* Ensure status is visible on Eventin hover effects */
.etn-speaker-item:hover .speaker-status-indicator,
.etn-speaker-card:hover .speaker-status-indicator {
    transform: scale(1.1);
}

/* Fix for Eventin overlay conflicts */
.etn-speaker-overlay + .speaker-status-indicator,
.speaker-overlay + .speaker-status-indicator {
    z-index: 10000;
}

/* Konferenz status initialized flag */
body.konferenz-status-initialized .konferenz-status-container {
    display: block;
}

/* Loading state for status containers */
.konferenz-status-container:empty::before {
    content: "Loading status...";
    color: #95a5a6;
    font-size: 12px;
    font-style: italic;
}