/**
 * Praxis Urlaub Popup - Frontend Styles
 */

/* Overlay */
.pup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pup-overlay.pup-visible {
    opacity: 1;
}

/* Popup Container */
.pup-popup {
    background: #ffffff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.pup-overlay.pup-visible .pup-popup {
    transform: translateY(0);
}

/* Close Button */
.pup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 28px;
    color: #ffffff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
    z-index: 10;
}

.pup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Header */
.pup-header {
    background: linear-gradient(135deg, var(--pup-primary-color), color-mix(in srgb, var(--pup-primary-color) 80%, black));
    color: #ffffff;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    border-radius: 16px 16px 0 0;
}

.pup-icon {
    margin-bottom: 12px;
}

.pup-icon svg {
    width: 48px;
    height: 48px;
}

.pup-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.pup-dates {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Message */
.pup-message {
    padding: 16px 24px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    margin: 0;
    font-size: 14px;
    color: #92400e;
    line-height: 1.5;
}

/* Content */
.pup-content {
    padding: 24px;
}

.pup-subtitle {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

/* Subtitle row with schedule label */
.pup-subtitle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.pup-subtitle-row .pup-subtitle {
    margin: 0;
}

.pup-schedule-label {
    font-size: 14px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 12px;
}

.pup-no-substitute {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

.pup-subtitle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.pup-subtitle-row .pup-subtitle {
    margin: 0;
}

.pup-day-indicator {
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.pup-no-substitute {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
}

/* Time Sections */
.pup-time-section {
    margin-bottom: 20px;
}

.pup-time-section:last-child {
    margin-bottom: 0;
}

.pup-time-header {
    margin-bottom: 12px;
}

/* Vertretung Grid */
.pup-vertretung-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.pup-vertretung-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.pup-vertretung-card:hover {
    border-color: var(--pup-primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Time Badge */
.pup-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--pup-primary-color);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.pup-time-badge svg {
    width: 14px;
    height: 14px;
}

.pup-time-badge.pup-afternoon {
    background: #6366f1;
}

/* Card Content */
.pup-hours {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.pup-doctor-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.pup-address {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    line-height: 1.4;
}

.pup-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pup-primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.pup-phone:hover {
    color: color-mix(in srgb, var(--pup-primary-color) 80%, black);
}

.pup-phone svg {
    width: 16px;
    height: 16px;
}

/* Footer */
.pup-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    background: #fafafa;
    border-radius: 0 0 16px 16px;
}

.pup-emergency {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #6b7280;
}

.pup-emergency strong {
    color: #dc2626;
    font-weight: 700;
}

.pup-button {
    background: var(--pup-primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pup-button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pup-button:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 640px) {
    .pup-overlay {
        padding: 16px;
    }
    
    .pup-popup {
        max-height: 95vh;
    }
    
    .pup-header {
        padding: 24px 20px;
    }
    
    .pup-title {
        font-size: 20px;
    }
    
    .pup-dates {
        font-size: 14px;
    }
    
    .pup-content {
        padding: 20px;
    }
    
    .pup-vertretung-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .pup-footer {
        padding: 16px 20px;
    }
    
    .pup-icon svg {
        width: 40px;
        height: 40px;
    }
}

/* Scrollbar Styling */
.pup-popup::-webkit-scrollbar {
    width: 8px;
}

.pup-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 16px 16px 0;
}

.pup-popup::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.pup-popup::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Animation for entrance */
@keyframes pupFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pupSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pup-popup {
        border: 2px solid #000;
    }
    
    .pup-vertretung-card {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pup-overlay,
    .pup-popup,
    .pup-close,
    .pup-button,
    .pup-phone,
    .pup-vertretung-card {
        transition: none;
    }
}
