* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 2000px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

h1 {
    color: #2d3748;
    font-size: 22px;
    margin-bottom: 30px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 15px;
}

h2 {
    color: #4a5568;
    font-size: 20px;
    margin-bottom: 20px;
}

.section {
    margin: 40px 0;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

/* Master Level Section */
.master-level-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.master-level-section h2 {
    color: white;
    margin-bottom: 15px;
}

.master-level-value {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 28px;
}

.master-level-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-master {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-master:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* PIR Section */
.pir-status-section {
    background: #f8f9fa;
}

.pir-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pir-timeout {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeout-label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 600;
}

.timeout-value {
    font-size: 22px;
    font-weight: bold;
    color: #667eea;
    min-width: 35px;
    text-align: center;
}

.timeout-status {
    font-size: 20px;
}

.timeout-status.active {
    color: #dc3545;
    animation: pulse 1s infinite;
}

.timeout-status.inactive {
    color: #48bb78;
}

.pir-grid-compact {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pir-compact {
    flex: 0 0 auto;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: white;
    min-width: 120px;
}

.pir-compact.online {
    border-color: #48bb78;
}

.pir-compact.offline {
    border-color: #a0aec0;
    opacity: 0.6;
}

.pir-id {
    font-size: 12px;
    font-weight: bold;
    color: #4a5568;
    margin-bottom: 8px;
}

.pir-dots {
    display: flex;
    gap: 8px;
}

.pir-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.pir-dot.green {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.pir-dot.red {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    animation: pulse 1s infinite;
}

.pir-dot.gray {
    background: linear-gradient(135deg, #a0aec0, #718096);
}

.pir-status {
    text-align: center;
    color: #a0aec0;
    font-size: 12px;
    font-weight: 600;
}

/* Client Cards */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.client-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* .client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
} */

.online-card {
    border-color: #48bb78;
}

.offline-card {
    border-color: #a0aec0;
    opacity: 0.7;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.card-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 20px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.status-badge.online {
    background: #48bb78;
    color: white;
}

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

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
       background: #3c4dcc;
    color: white;
}




.card-info {
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f7fafc;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #718096;
    font-weight: 600;
    min-width: 90px;
}

.info-value {
    color: #2d3748;
    font-family: monospace;
    font-size: 13px;
}

.info-value.status-playing {
    color: #48bb78;
    font-weight: bold;
}

.io-dots-inline {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.io-dot-simple {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    transition: all 0.3s;
}

.io-dot-simple.gray {
    background: #cbd5e0;
}

.io-dot-simple.red {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    animation: pulse 1s infinite;
    box-shadow: 0 0 10px rgba(245, 101, 101, 0.5);
}

/* Schedule indicator dot - stejný styl jako IO tečky */
.schedule-indicator-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    margin-left: 10px;
    vertical-align: middle;
}

.schedule-indicator-dot.active {
    background: linear-gradient(135deg, #48bb78, #38a169);
    animation: pulse 1s infinite;
    box-shadow: 0 0 10px rgba(72, 187, 120, 0.5);
}

.schedule-indicator-dot.inactive {
    background: #cbd5e0;
}

/* Timeout indicator dot - stejný styl jako IO tečky */
.timeout-indicator-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.timeout-indicator-dot.active {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    animation: pulse 1s infinite;
    box-shadow: 0 0 10px rgba(245, 101, 101, 0.5);
}

.timeout-indicator-dot.inactive {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

/* Odstraň staré styly */
.status-indicator {
    display: none;
}

.timeout-status {
    /* Ponech pouze jako fallback */
}

/* Details element styling */
details.json-details[open] {
    background: #f7fafc;
    padding: 10px;
    border-radius: 6px;
}

details.json-details summary {
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
    font-size: 13px;
    padding: 5px;
    user-select: none;
}

details.json-details summary:hover {
    color: #5568d3;
}

.json-output {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 11px;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.offline-text {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
    font-size: 16px;
}

/* Forms and Buttons */
.form-group {
    margin: 15px 0;
}

.form-group label {
    display: block;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 8px;
}

select, input {
    width: 100%;
    max-width: 500px;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

select:focus, input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: start;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-item label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

#control-status {
    grid-column: 1 / -1;
    min-height: 30px;
}

.success-inline {
    color: #48bb78;
    font-size: 14px;
    font-weight: 600;
}

.error-inline {
    color: #f56565;
    font-size: 14px;
    font-weight: 600;
}

.success {
    color: #48bb78;
    background: #f0fff4;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #48bb78;
}

.error {
    color: #f56565;
    background: #fff5f5;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #f56565;
}

/* Master Level Container */
.master-level-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.master-level-left {
    flex: 1;
}

.schedule-frame {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    min-width: 200px;
}

.schedule-frame h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 18px;
    /* border-bottom: 2px solid rgba(255, 255, 255, 0.3); */
    /* padding-bottom: 10px; */
}

.schedule-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.schedule-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schedule-row:last-child {
    border-bottom: none;
}

.schedule-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
}
.schedule-value-time {
    color: #667eea;
    font-size: 20px;
    font-weight: bold;
    font-family: monospace;
    margin: 0;
}

.schedule-value {
    color: white;
    text-align: right;
    font-size: 16px;
    font-weight: bold;
    font-family: monospace;
}

.schedule-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    display: none;
}

.status-indicator.active {
    color: #48bb78;
    /* animation: pulse 2s infinite; */
}

.status-indicator.inactive {
    color: #a0aec0;
}

/* Animations */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-row h1 {
    margin: 0;
    border: none;
    padding: 0;
}

/* Control section - sjednocená sekce */
.control-subsection {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.control-subsection h3 {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 18px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.control-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.control-select {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    min-width: 120px;
}

.control-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.btn-control {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.status-msg {
    min-height: 30px;
    margin-top: 10px;
}

/* Projector individual grid */
.projector-individual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.projector-client-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 6px;
}

.client-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 70px;
}

.btn-projector-small {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-projector-small.on {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-projector-small.on:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.4);
}

.btn-projector-small.off {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.btn-projector-small.off:hover {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.4);
}

/* Update existing projector controls */
.projector-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-projector {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}