body { font-family: 'Segoe UI', sans-serif; margin: 0; padding: 20px; background: #f0f2f5; }
        
.main-container { 
    display: flex; 
    gap: 20px; 
    max-width: 1200px; 
    margin: auto; 
    flex-direction: row; 
}

.admin-controls { flex: 1; min-width: 300px; }

.preview-section { 
    flex: 1; 
    position: sticky; 
    top: 20px; 
    height: fit-content;
}

#display-box { 
    padding: 40px; background: #2c3e50; color: white; 
    border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-align: center; min-height: 150px; 
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8em; transition: opacity 0.5s;
}

.admin-panel { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 20px; }
.section-title { border-bottom: 2px solid #eee; padding-bottom: 10px; margin-top: 0; font-size: 1.1em; color: #333; }

input, button { padding: 10px; margin: 5px 0; width: 100%; box-sizing: border-box; border-radius: 5px; border: 1px solid #ccc; }
button { cursor: pointer; font-weight: bold; transition: 0.3s; background: #3498db; color: white; border: none; }
button:hover { background: #2980b9; }

.btn-emergency { background: #e74c3c; }
.btn-add { background: #27ae60; }

#messageList { list-style: none; padding: 0; }
.message-item { 
    background: #fff; border: 1px solid #eee; margin-bottom: 8px; 
    padding: 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 0.9em;
}

/* Kolorowanie krawędzi elementów na liście wiadomości */
.message-item.status-past { 
    border-left: 8px solid #e74c3c !important; 
    background: #fffafa;
}
.message-item.status-active { 
    border-left: 8px solid #27ae60 !important; 
    background: #fafffa;
}
.message-item.status-future { 
    border-left: 8px solid #f1c40f !important; 
    background: #fffff0;
}

/* Legenda statusów */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    background: #eaeff2;
    padding: 12px;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    transition: all 0.2s;
    border: 1px solid transparent;
    background: transparent;
    user-select: none;
}

.legend-item:hover { background: rgba(0,0,0,0.05); }
.legend-item.active-filter {
    background: white;
    border-color: #bdc3c7;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dot { width: 10px; height: 10px; border-radius: 50%; }

/* Badges */
.badge {
    font-size: 0.65em;
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
    font-weight: 800;
    margin-right: 8px;
    display: inline-block;
}
.badge-image { background: #3498db; }
.badge-video { background: #9b59b6; letter-spacing: 0.5px; }
.badge-text  { background: #95a5a6; }

/* Sekcja Display (Ekrany) */
.display-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 15px;
}

.action-circle {
    width: 34px !important; /* Wymuszenie stałej szerokości */
    height: 34px !important;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.15); 
    transition: all 0.3s ease;
    padding: 0 !important; /* Ważne dla koła */
}

.action-circle svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.btn-edit:hover { background-color: #3498db !important; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.btn-delete-display:hover { background-color: #e74c3c !important; box-shadow: 0 2px 8px rgba(0,0,0,0.2); } /* Zmieniona nazwa klasy dla ekranów */

.action-circle:hover svg { fill: #ffffff; transform: scale(1.1); }

.display-badge {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Przyciski usuwania na liście wiadomości */
.message-info { flex-grow: 1; }
.btn-delete-msg { /* Zmieniona nazwa klasy dla wiadomości */
    width: auto; 
    background: #ff4d4d; 
    color: white; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.8em;
}
.btn-delete-msg:hover { background: #cc0000; }

#emergencyStatusBadge {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #c0392b;
    animation: blinker 2s linear infinite;
}

#ticker-preview-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #c0392b;
    color: white;
    height: 30px;
    display: none;
    align-items: center;
    overflow: hidden;
    font-size: 0.9em;
    white-space: nowrap;
    border-top: 2px solid #fff;
    z-index: 10;
}

#ticker-preview-text {
    display: inline-block;
    padding-left: 100%;
    white-space: nowrap; /* Konieczne */
    will-change: transform;
}

@keyframes ticker-animation {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

@keyframes blinker { 50% { opacity: 0.7; } }

@media (max-width: 768px) {
    .main-container { flex-direction: column; }
    .preview-section { order: 2; position: static; }
    .admin-controls { order: 1; }
}