/**
 * Kamillus Fahrdienstplaner - Public Styles
 */

.kfp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.kfp-header {
    margin-bottom: 30px;
    text-align: center;
}

.kfp-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.kfp-header p {
    color: #7f8c8d;
    font-size: 14px;
}

/* Controls */
.kfp-controls {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.kfp-control-group {
    margin-bottom: 20px;
}

.kfp-control-group:last-child {
    margin-bottom: 0;
}

.kfp-control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.kfp-date-input,
.kfp-text-input {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.kfp-calendars {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.kfp-calendar-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.kfp-calendar-option:hover {
    background: #e9ecef;
    border-color: #2271b1;
}

.kfp-calendar-option input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.kfp-calendar-option input[type="checkbox"]:checked + label,
.kfp-calendar-option:has(input[type="checkbox"]:checked) {
    background: #d4edff;
    border-color: #2271b1;
    font-weight: 600;
}

/* Buttons */
.kfp-button {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 10px;
}

.kfp-button-primary {
    background: #2271b1;
    color: #fff;
}

.kfp-button-primary:hover {
    background: #135e96;
}

.kfp-button-success {
    background: #00a32a;
    color: #fff;
}

.kfp-button-success:hover {
    background: #008a20;
}

.kfp-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.kfp-loading {
    text-align: center;
    padding: 40px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.kfp-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: kfp-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes kfp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Appointments */
.kfp-appointments {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.kfp-appointments h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
}

#kfp-appointments-list {
    margin-bottom: 20px;
}

.kfp-appointment {
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    margin-bottom: 10px;
}

.kfp-appointment-time {
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 5px;
}

.kfp-appointment-patient {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.kfp-appointment-location {
    color: #7f8c8d;
    font-size: 14px;
}

.kfp-appointment-calendar {
    display: inline-block;
    padding: 4px 8px;
    background: #2271b1;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    margin-top: 8px;
}

/* Route */
.kfp-route {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
}

.kfp-route h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
}

#kfp-route-info {
    background: #e7f5ff;
    border-left: 4px solid #2271b1;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.kfp-route-stat {
    display: inline-block;
    margin-right: 30px;
    font-weight: 600;
}

.kfp-route-stat-label {
    color: #7f8c8d;
    font-weight: normal;
}

#kfp-route-list {
    margin-bottom: 20px;
}

.kfp-waypoint {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
    position: relative;
}

.kfp-waypoint-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    margin-right: 15px;
}

.kfp-waypoint-content {
    flex-grow: 1;
}

.kfp-waypoint-patient {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.kfp-waypoint-time {
    color: #2271b1;
    font-weight: 600;
    margin-bottom: 5px;
}

.kfp-waypoint-location {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 5px;
}

.kfp-waypoint-meta {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 13px;
    color: #7f8c8d;
}

.kfp-waypoint-distance,
.kfp-waypoint-duration {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Map */
#kfp-route-map {
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
}

/* Actions */
.kfp-route-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Appointment Table */
.kfp-appointment-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 13px;
    background: #fff;
}

.kfp-appointment-table th,
.kfp-appointment-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.kfp-appointment-table th {
    background-color: #2271b1;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.kfp-appointment-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.kfp-appointment-table tr:hover {
    background-color: #e8f4f8;
}

.kfp-appointment-table input[type="text"] {
    border: 1px solid #8c8f94;
    border-radius: 3px;
    padding: 6px 8px;
    font-size: 13px;
    width: 100%;
}

.kfp-appointment-table input[type="text"]:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.kfp-appointment-editable {
    transition: all 0.2s;
}

.kfp-appointment-editable:hover {
    background-color: #f0f6fc;
}

/* Confirmed Route */
.kfp-confirmed {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.kfp-success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}

.kfp-success-message h3 {
    color: #155724;
    margin-top: 0;
    margin-bottom: 10px;
}

.kfp-success-message p {
    color: #155724;
    margin-bottom: 0;
}

/* Error */
.kfp-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 15px;
    color: #721c24;
    margin-bottom: 20px;
}

/* Print Styles */
@media print {
    .kfp-controls,
    .kfp-route-actions,
    .kfp-button {
        display: none !important;
    }

    .kfp-container {
        max-width: 100%;
    }

    .kfp-waypoint {
        page-break-inside: avoid;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .kfp-calendars {
        flex-direction: column;
    }

    .kfp-calendar-option {
        width: 100%;
    }

    .kfp-route-actions {
        flex-direction: column;
    }

    .kfp-button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}
