/**
 * Patienten-Portal Styles
 * Praxis Diana Perske
 */

:root {
    --primary: #7c9885;
    --primary-dark: #5a7a63;
    --primary-light: #e8f0ea;
    --success: #28a745;
    --success-light: #d4edda;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --warning: #ffc107;
    --warning-light: #fff3cd;
    --text: #333;
    --text-muted: #666;
    --text-light: #888;
    --bg: #f8f9fa;
    --bg-white: #fff;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 100%);
}

.portal-container {
    width: 100%;
    max-width: 420px;
}

.portal-box {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.portal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.portal-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.portal-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.portal-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.welcome-text {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius);
}

.welcome-text p {
    margin: 0;
}

.welcome-text .hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 152, 133, 0.2);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* PIN Input - einzelnes Feld (Legacy) */
.pin-form input#pin {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
    font-family: monospace;
}

/* PIN Input - 6 einzelne Felder */
.pin-input-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 1.5rem 0;
}

.pin-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
    background: var(--bg-white);
}

.pin-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 152, 133, 0.2);
}

.pin-input::-webkit-outer-spin-button,
.pin-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pin-hint {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Responsive PIN-Felder */
@media (max-width: 400px) {
    .pin-input-group {
        gap: 6px;
    }
    .pin-input {
        width: 42px;
        height: 52px;
        font-size: 20px;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: var(--success-light);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: var(--danger-light);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: var(--warning-light);
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Portal Info */
.portal-info {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.portal-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.back-link {
    color: var(--primary);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* =====================================================
   PORTAL PAGE (MAIN VIEW)
   ===================================================== */

.portal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Bar */
.portal-header-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-text {
    font-weight: 600;
    color: var(--primary-dark);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.9rem;
}

.logout-btn:hover {
    text-decoration: underline;
}

/* Main Content */
.portal-main {
    flex: 1;
    padding: 2rem 1rem;
}

.portal-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 0.875rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.card-header .date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.sort-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sort-toggle-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.card-body {
    padding: 1.25rem;
}

/* Contact Details */
.contact-details {
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.detail-row .label {
    width: 100px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-row .value {
    flex: 1;
}

.contact-message {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.contact-message .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.message-text {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius);
    white-space: pre-wrap;
}

.contact-status {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.status-confirmed {
    background: var(--success-light);
    color: #155724;
}

/* Messages */
.no-messages {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.no-messages .hint {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.messages-list {
    max-height: 60vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.message {
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    text-align: left;
    max-width: 85%;
}

.message:last-child {
    margin-bottom: 0;
}

.message-practice {
    background: var(--primary-light);
    margin-left: 0;
    margin-right: auto;
    border-left: 3px solid var(--primary);
}

.message-patient {
    background: var(--bg);
    margin-left: auto;
    margin-right: 0;
    border-right: 3px solid #888;
}

.message-system {
    background: var(--warning-light);
    margin: 0.5rem 2rem;
    text-align: left;
    font-size: 0.8rem;
    padding: 0.6rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}

.message-header .sender {
    font-weight: 500;
}

.message-header .time {
    color: var(--text-light);
}

.message-body {
    word-wrap: break-word;
    text-align: left;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Appointment Box */
.appointment-box {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 2px solid var(--primary);
}

.appointment-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.appointment-details {
    margin-bottom: 1rem;
}

.appointment-date {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.appointment-duration {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.appointment-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.appointment-status .badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge-success {
    background: var(--success-light);
    color: #155724;
}

.badge-warning {
    background: var(--warning-light);
    color: #856404;
}

/* New Message Form */
.message-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* Info Box */
.info-box {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primary);
    margin-bottom: 1rem;
}

.info-box h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.info-box ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.info-box li {
    margin-bottom: 0.35rem;
}

/* =====================================================
   FIXIERTE CHAT-EINGABE (WhatsApp-Style)
   ===================================================== */

.chat-input-bar {
    position: fixed;
    bottom: 36px;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(250, 249, 247, 0.95), rgba(250, 249, 247, 1));
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.875rem 1rem;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chat-input-container {
    max-width: 800px;
    margin: 0 auto;
}

.chat-form {
    margin: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border-radius: 28px;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(124, 152, 133, 0.2);
}

.chat-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    min-height: 28px;
    max-height: 120px;
    padding: 0.4rem 0;
    outline: none;
    vertical-align: middle;
}

.chat-input-wrapper textarea::placeholder {
    color: #999;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(124, 152, 133, 0.4);
}

.chat-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(124, 152, 133, 0.5);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn svg {
    margin-left: 2px;
}

/* Footer - Fixiert */
footer.portal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f5f4f2;
    border-top: 1px solid #e8e6e3;
    padding: 0.4rem 1rem;
    text-align: center;
    font-size: 0.7rem;
    color: #888;
    z-index: 99;
}

footer.portal-footer a {
    color: var(--primary-dark);
    text-decoration: none;
}

footer.portal-footer a:hover {
    text-decoration: underline;
}

/* Main Content Padding für fixierte Elemente */
main.portal-main {
    padding-bottom: 140px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 600px) {
    .portal-box {
        padding: 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .message-practice {
        margin-right: 0.5rem;
        max-width: 95%;
    }
    
    .message-patient {
        margin-left: 0.5rem;
        max-width: 95%;
    }
    
    .appointment-actions {
        flex-direction: column;
    }
    
    .inline-form {
        flex-direction: column;
        width: 100%;
    }
    
    .inline-form button {
        width: 100%;
    }
    
    /* Chat-Eingabe Mobile */
    .chat-input-bar {
        padding: 0.5rem;
    }
    
    .chat-input-wrapper {
        padding: 0.35rem 0.35rem 0.35rem 0.75rem;
    }
    
    .chat-send-btn {
        width: 38px;
        height: 38px;
    }
    
    main.portal-main {
        padding-bottom: 120px;
    }
}

/* PIN-Sektion */
.pin-section .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pin-section .card-body {
    text-align: left;
}

.pin-section .card-body input[type="text"],
.pin-section .card-body input[type="password"] {
    border: 2px solid var(--border);
    border-radius: var(--radius);
}

.pin-section .card-body input[type="text"]:focus,
.pin-section .card-body input[type="password"]:focus {
    border-color: var(--primary);
    outline: none;
}

.pin-section .card-body input[type="radio"],
.pin-section .card-body input[type="checkbox"] {
    flex-shrink: 0;
}

/* ========================================
   Einklappbare Anfrage-Kachel
   ======================================== */

.collapsible .card-header.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.collapsible .card-header.collapsible-header:hover {
    background-color: rgba(0,0,0,0.02);
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.collapsible-header .header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.collapsible-header .header-left h2 {
    margin: 0;
    white-space: nowrap;
}

.collapsible-header .header-summary {
    color: #888;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collapsible-header .header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.collapse-icon {
    font-size: 0.75rem;
    color: #888;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.collapsible:not(.collapsed) .collapse-icon {
    transform: rotate(90deg);
}

/* Status-Badge Mini (im Header) */
.status-badge-mini {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-mini.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.status-badge-mini.status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Einklappbarer Inhalt */
.collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.collapsible.collapsed .collapsible-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* Status-Detail unten (klein) */
.contact-status-detail {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
    color: #888;
}

.contact-status-detail small {
    font-size: 0.8rem;
}

/* Header-Summary ausblenden wenn aufgeklappt */
.collapsible:not(.collapsed) .header-summary {
    display: none;
}

/* Mobile Anpassungen */
@media (max-width: 600px) {
    .collapsible-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .collapsible-header .header-right {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.25rem;
    }
    
    .collapsible-header .header-summary {
        display: none;
    }
}

/* ========================================
   Ungelesene Nachrichten & Verbesserungen
   ======================================== */

/* Kommunikation Header mit Badge */
.messages-section .card-header .header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.messages-section .card-header .header-title h2 {
    margin: 0;
}

/* Ungelesene Badge */
.unread-badge {
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Neue Nachricht Badge */
.message-unread {
    border-left: 3px solid #dc3545;
    background: linear-gradient(to right, #fff5f5 0%, #ffffff 100%);
}

.message .new-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.message {
    position: relative;
}

/* Gelesen-Status unter Nachrichten */
.read-status {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
    text-align: right;
}

.read-status small {
    color: #888;
    font-size: 0.75rem;
}

/* Zeit mit Hover-Tooltip */
.message-header .time {
    cursor: help;
}

/* Push-Notification Button */
.notification-prompt {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.notification-prompt p {
    margin: 0;
    color: #004085;
    font-size: 0.9rem;
}

.notification-prompt .btn-notify {
    background: #004085;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}

.notification-prompt .btn-notify:hover {
    background: #003060;
}

.notification-prompt .btn-dismiss {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Smooth Scroll Animation */
.scroll-highlight {
    animation: highlight-flash 1.5s ease;
}

@keyframes highlight-flash {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

/* Mobile Anpassungen */
@media (max-width: 600px) {
    .notification-prompt {
        flex-direction: column;
        text-align: center;
    }
    
    .notification-prompt .btn-notify {
        width: 100%;
    }
}

/* ========================================
   Toast Notifications
   ======================================== */

#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 0.85rem;
    min-width: 250px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.toast-show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: #d4edda;
    color: #155724;
}

.toast-error .toast-icon {
    background: #f8d7da;
    color: #721c24;
}

.toast-info .toast-icon {
    background: #d1ecf1;
    color: #0c5460;
}

.toast-message {
    flex: 1;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin-left: 0.5rem;
}

.toast-close:hover {
    color: #666;
}

@media (max-width: 480px) {
    #toast-container {
        left: 0.5rem;
        right: 0.5rem;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ========================================
   Info/Hinweise Modal
   ======================================== */

.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.info-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.info-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.info-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 1.25rem;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.info-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.info-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
    border-bottom: 1px solid var(--border);
}

.info-modal-icon {
    font-size: 1.5rem;
}

.info-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.info-modal-body {
    padding: 1.25rem 1.5rem;
}

.info-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-item-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-item-text {
    flex: 1;
}

.info-item-text strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.info-item-text p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.info-modal-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid var(--border);
    text-align: center;
}

.info-modal-footer .btn {
    min-width: 140px;
}

@media (max-width: 480px) {
    .info-modal {
        padding: 0.5rem;
    }
    
    .info-modal-content {
        border-radius: 12px;
    }
    
    .info-modal-header {
        padding: 1rem 1.25rem;
    }
    
    .info-modal-body {
        padding: 1rem 1.25rem;
    }
    
    .info-item {
        padding: 0.75rem 0;
    }
    
    .info-item-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* ========================================
   Nächster Termin Card
   ======================================== */

.next-appointment-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #81c784;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.next-appointment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #4caf50;
}

.appointment-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.appointment-content {
    flex: 1;
}

.appointment-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2e7d32;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.appointment-datetime {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.apt-day {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1b5e20;
}

.apt-date {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2e7d32;
}

.apt-time {
    font-size: 1rem;
    color: #388e3c;
    background: rgba(255,255,255,0.5);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.appointment-type {
    font-size: 0.85rem;
    color: #388e3c;
    margin-top: 0.25rem;
}

.appointment-notes {
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
}

.appointment-status {
    text-align: right;
    flex-shrink: 0;
}

.appointment-status .status-confirmed {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.appointment-status .status-pending {
    display: block;
    color: #f57c00;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.appointment-actions-mini {
    margin-top: 0.5rem;
}

.btn-confirm-apt {
    background: #4caf50;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-confirm-apt:hover {
    background: #388e3c;
}

@media (max-width: 600px) {
    .next-appointment-card {
        flex-direction: column;
        text-align: center;
    }
    
    .next-appointment-card::before {
        width: 100%;
        height: 4px;
    }
    
    .appointment-datetime {
        justify-content: center;
    }
    
    .appointment-status {
        text-align: center;
        margin-top: 0.5rem;
    }
}
