/* =================================
   Grund-Layout
   ================================= */
body {
    background-color: #1c1c1c;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 95%;
    margin: auto;
}

.header-container {
    text-align: center;
    margin-bottom: 10px;
}

.clock {
    font-size: 2.5em;
    font-weight: 300;
    color: #a0a0a0;
    font-family: 'monospace', sans-serif;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

h1 {
    font-size: 2.2em;
    margin-top: 0;
    margin-bottom: 15px;
}

#last-modified-info {
    text-align: center;
    color: #888;
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 0.7em;
}

/* =================================
   Stile für die Pillendose
   ================================= */
.pillbox {
    display: flex;
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    border: 1px solid #555;
    border-radius: 8px;
    overflow: hidden;
    background-color: #333;
    transition: background-color 0.5s ease;
}

.finished-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 1.0em;
    font-weight: bold;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    display: none;
}

.pillbox.is-finished .compartment .label {
    visibility: hidden;
}

.cross-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
    z-index: 15;
}

.cross-line {
    position: absolute;
    background-color: #ce0a1a;
    height: 4px;
    border-radius: 2px;
    top: 50%;
    left: 0;
    right: 0;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.cross-line.line1 {
    transform: rotate(10deg);
}

.cross-line.line2 {
    transform: rotate(-10deg);
}

.pillbox::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2));
    pointer-events: none;
}

.compartment {
    flex: 1;
    padding: 15px 5px;
    text-align: center;
    transition: all 0.3s ease;
    border-left: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: -1px 0 0 rgba(255, 255, 255, 0.05);
}

.compartment:first-child {
    border-left: none;
    box-shadow: none;
}

.compartment .label {
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.compartment.active {
    z-index: 10;
    animation: strong-pulse 1.2s infinite ease-in-out;
}

@keyframes strong-pulse {
    0% {
        transform: scale(1.0);
        background-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.1);
        background-color: rgba(255, 255, 255, 0.7);
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    }
    100% {
        transform: scale(1.0);
        background-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    }
}

.pillbox.color-rot { background-color: #ce0a1a; }
.pillbox.color-orange { background-color: #F37B22; }
.pillbox.color-gelb { background-color: #FDC400; }
.pillbox.color-hellgruen { background-color: #b8c508; }
.pillbox.color-gruen { background-color: #64c34a; }
.pillbox.color-petrol { background-color: #0072BB; }
.pillbox.color-nachtblau { background-color: #313170; }


/* =================================
   Restliche Stile
   ================================= */
.status-box {
    display: flex;
    align-items: center;
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#essen-icon {
    width: 60px;
    height: 60px;
    margin-right: 20px;
    flex-shrink: 0;
}

.info-text {
    font-size: 1.2em;
    font-weight: bold;
}

.countdown {
    display: block;
    font-size: 0.8em;
    color: #ccc;
    font-family: monospace;
    font-weight: normal;
    margin-top: 5px;
}

.fokus-block {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
}

.nav-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #444;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 20px;
}

.nav-button.secondary {
    background-color: #c0392b;
}

.editor-table-container {
    overflow-x: auto;
}

#med-editor-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: fixed;
}

#med-editor-table th,
#med-editor-table td {
    border: 1px solid #444;
    padding: 8px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#med-editor-table th {
    background-color: #333;
}

#med-editor-table input[type="text"],
#med-editor-table input[type="number"] {
    width: 98%;
    box-sizing: border-box;
    background-color: #3a3a3a;
    color: white;
    border: 1px solid #555;
    padding: 5px;
    border-radius: 3px;
}

#med-editor-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
    display: block;
    margin: auto;
}

.action-button {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-right: 10px;
}

.action-button.primary {
    background-color: #4CAF50;
    color: white;
}

.action-button.secondary {
    background-color: #f44336;
    color: white;
}

.footer-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

#status-message {
    margin-top: 15px;
    font-weight: bold;
}

#med-editor-table tr.paused-row td {
    background-color: #2a2a2a !important;
    color: #666;
    opacity: 0.7;
}

#med-editor-table tr.paused-row input,
#med-editor-table tr.paused-row input[type="text"],
#med-editor-table tr.paused-row input[type="number"] {
    color: #888 !important;
    background-color: #333 !important;
}

#med-editor-table tr.paused-row button {
    opacity: 0.5;
}

#med-editor-table .header-time {
    font-size: 0.8em;
    font-weight: normal;
    color: #ccc;
}

#med-editor-table .col-wirkstoff { width: 20%; }
#med-editor-table .col-handelsname { width: 22%; }
#med-editor-table .col-dosierung { width: 7%; text-align: center; }
#med-editor-table .col-einheit { width: 8%; }
#med-editor-table .col-hinweis { width: 22%; min-width: 120px; }
#med-editor-table .col-aktiv { width: 5%; text-align: center; }
#med-editor-table .col-aktionen { width: 5%; text-align: center; }

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

.header-bar h1 {
    margin: 0 15px 10px 0;
}

/* =================================
   WIEDERHERGESTELLT: Stile für die BMP-Ansicht
   ================================= */
.bmp-container {
    background-color: white;
    color: black;
    padding: 25px;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-width: 1100px;
    font-family: Arial, sans-serif;
    font-size: 11pt;
}
.bmp-container h1 {
    color: black;
    font-size: 24pt;
    font-weight: bold;
    text-align: left;
}
.bmp-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid black;
}
.bmp-table th, .bmp-table td {
    border: 1px solid #888;
    padding: 6px 8px;
    vertical-align: top;
    text-align: left;
}
.bmp-table th {
    background-color: #EFEFEF;
    font-weight: bold;
}
.bmp-table .dosierung-header {
    width: 6%;
    text-align: center;
}
.bmp-table .dosierung {
    text-align: center;
}
.bmp-table th:nth-child(4),
.bmp-table td:nth-child(4) {
    border-right: 2px solid black;
}
.bmp-table th:nth-child(8),
.bmp-table td:nth-child(8) {
    border-right: 2px solid black;
}

/* =================================
   Responsive Anpassungen
   ================================= */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .status-box {
        flex-direction: column;
        text-align: center;
    }

    #essen-icon {
        margin-right: 0;
        margin-bottom: 15px;
        width: 80px;
        height: 80px;
    }

    .info-text {
        font-size: 1.4em;
    }

    .clock {
        font-size: 2.0em;
    }

    h1 {
        font-size: 1.5em;
    }

    .countdown {
        font-size: 0.7em;
    }

    .header-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .header-bar h1 {
        margin-bottom: 15px;
    }

    .header-bar div {
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    #edit-button-main {
        display: none !important;
    }
}
