/* Bahnhof Apotheke Dienstbereitschaft Styles */

/* Form Wrapper */
.ba-dienst-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.ba-dienst-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.ba-dienst-header h2 {
    margin: 0;
    color: #333;
}

.ba-dienst-logout {
    padding: 8px 16px;
    background: #6c757d;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.ba-dienst-logout:hover {
    background: #5a6268;
    color: #fff;
}

/* Messages */
.ba-dienst-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.ba-dienst-message.success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.ba-dienst-message.error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Form Styles */
.ba-dienst-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.ba-dienst-form-group {
    margin-bottom: 20px;
}

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

.ba-dienst-form-group .required {
    color: #dc3545;
}

.ba-dienst-form-group input[type="date"],
.ba-dienst-form-group input[type="time"],
.ba-dienst-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.ba-dienst-form-group input:focus,
.ba-dienst-form-group textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.ba-dienst-form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* Form Row (for Von/Bis side by side) */
.ba-dienst-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Form Actions */
.ba-dienst-form-actions {
    margin-top: 30px;
}

.ba-dienst-submit {
    background: #0066cc;
    color: #fff;
    padding: 14px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.ba-dienst-submit:hover {
    background: #0052a3;
}

.ba-dienst-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* List Wrapper */
.ba-dienst-list-wrapper {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ba-dienst-list-wrapper h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

/* Table Styles */
.ba-dienst-table {
    width: 100%;
    border-collapse: collapse;
}

.ba-dienst-table thead {
    background: #f8f9fa;
}

.ba-dienst-table th,
.ba-dienst-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.ba-dienst-table th {
    font-weight: 600;
    color: #495057;
}

.ba-dienst-table tr.past {
    opacity: 0.5;
}

.ba-dienst-table tr:hover {
    background: #f8f9fa;
}

/* Delete Button */
.ba-dienst-delete {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.ba-dienst-delete:hover {
    background: #c82333;
}

.ba-dienst-delete .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Loading & No Data */
.ba-dienst-list .loading,
.ba-dienst-list .no-data,
.ba-dienst-list .error {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

.ba-dienst-list .error {
    color: #dc3545;
}

/* ===== Frontend Display Styles ===== */

.ba-dienst-display {
    margin: 30px 0;
}

.ba-dienst-item-compact {
    background: #fff;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 12px;
    border-left: 3px solid #0066cc;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
}

.ba-dienst-item-compact.ist-heute {
    border-left-color: #28a745;
    background: #f0f9f4;
}

.dienst-zeitraum-text {
    display: inline;
}

.dienst-zeitraum-text strong {
    font-weight: 600;
    color: #000;
}

.dienst-notiz-compact {
    display: inline;
    color: #6c757d;
    font-style: italic;
    margin-left: 8px;
    font-size: 16px;
}

.ba-dienst-display.keine-dienstzeiten {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

/* ===== Responsive Design ===== */

@media (max-width: 768px) {
    .ba-dienst-wrapper {
        padding: 10px;
    }
    
    .ba-dienst-form,
    .ba-dienst-list-wrapper {
        padding: 20px;
    }
    
    .ba-dienst-form-row {
        grid-template-columns: 1fr;
    }
    
    .ba-dienst-form h3 {
        font-size: 16px;
        margin-top: 20px;
        margin-bottom: 10px;
    }
    
    .ba-dienst-table {
        font-size: 14px;
    }
    
    .ba-dienst-table th,
    .ba-dienst-table td {
        padding: 8px;
    }
    
    /* Stack table on mobile */
    .ba-dienst-table thead {
        display: none;
    }
    
    .ba-dienst-table,
    .ba-dienst-table tbody,
    .ba-dienst-table tr,
    .ba-dienst-table td {
        display: block;
        width: 100%;
    }
    
    .ba-dienst-table tr {
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        padding: 10px;
    }
    
    .ba-dienst-table td {
        text-align: right;
        padding: 8px 0;
        border-bottom: 1px solid #dee2e6;
        position: relative;
        padding-left: 50%;
    }
    
    .ba-dienst-table td:last-child {
        border-bottom: none;
    }
    
    .ba-dienst-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        font-weight: 600;
        text-align: left;
    }
    
    .ba-dienst-item-compact {
        font-size: 16px;
        padding: 12px 15px;
    }
    
    .dienst-notiz-compact {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ba-dienst-form,
    .ba-dienst-list-wrapper {
        padding: 15px;
    }
    
    .ba-dienst-item-compact {
        font-size: 15px;
        padding: 10px 12px;
    }
    
    .dienst-notiz-compact {
        display: block;
        margin-left: 0;
        margin-top: 5px;
        font-size: 13px;
    }
}
