/**
 * GroundX Anwesenheits-System - Styles
 * Version: 1.0
 * Datum: 13.11.2025
 */

/* =============================
   Anwesenheits-Button (Header)
============================= */
.gki-attendance-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    margin-right: 10px;
}

.gki-attendance-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.gki-attendance-button svg {
    width: 28px;
    height: 28px;
}

/* =============================
   Modal Overlay
============================= */
.gki-attendance-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.gki-attendance-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.gki-attendance-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================
   Modal Header
============================= */
.gki-attendance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gki-attendance-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.gki-trainer-name {
    margin: 4px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.gki-attendance-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gki-attendance-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* =============================
   Modal Body
============================= */
.gki-attendance-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.gki-attendance-intro {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 15px;
}

/* =============================
   Session-Liste
============================= */
.gki-session-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gki-session-card {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 16px;
}

.gki-session-card:hover {
    border-color: #667eea;
    background: #f7f9ff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.gki-session-time {
    flex-shrink: 0;
}

.gki-session-time-big {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.gki-session-date {
    font-size: 13px;
    color: #666;
}

.gki-session-info {
    flex: 1;
}

.gki-session-location {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.gki-session-capacity {
    font-size: 13px;
    color: #666;
}

.gki-session-arrow {
    font-size: 28px;
    color: #667eea;
    font-weight: 300;
}

/* =============================
   Teilnehmer-Ansicht
============================= */
.gki-attendance-participants {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gki-participants-header {
    margin-bottom: 20px;
}

.gki-back-to-sessions {
    background: #f3f4f6;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.gki-back-to-sessions:hover {
    background: #e5e7eb;
}

.gki-session-info-header {
    background: #f7f9ff;
    padding: 16px;
    border-radius: 10px;
    border: 2px solid #e0e7ff;
}

.gki-session-time-header {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.gki-session-location-header {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.gki-session-count-header {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
}

.gki-participants-actions {
    margin-bottom: 16px;
}

.gki-participants-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gki-participant-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 12px;
}

.gki-participant-item:hover {
    border-color: #667eea;
    background: #f7f9ff;
}

.gki-participant-item.already-attended {
    background: #f0fdf4;
    border-color: #bbf7d0;
    cursor: default;
    opacity: 0.7;
}

.gki-participant-checkbox {
    display: none;
}

.gki-checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gki-participant-checkbox:checked + .gki-checkbox-custom {
    background: #667eea;
    border-color: #667eea;
}

.gki-participant-checkbox:checked + .gki-checkbox-custom::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.gki-participant-checkbox:disabled + .gki-checkbox-custom {
    background: #10b981;
    border-color: #10b981;
}

.gki-participant-checkbox:disabled + .gki-checkbox-custom::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.gki-participant-info {
    flex: 1;
}

.gki-participant-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.gki-attended-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    background: #dcfce7;
    color: #166534;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.gki-participants-footer {
    padding-top: 16px;
    border-top: 2px solid #e5e7eb;
}

/* =============================
   Buttons
============================= */
.gki-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
}

.gki-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.gki-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.gki-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gki-btn-secondary {
    background: #f3f4f6;
    color: #333;
    border: 2px solid #e5e7eb;
}

.gki-btn-secondary:hover {
    background: #e5e7eb;
}

/* =============================
   Loader
============================= */
.gki-attendance-loader,
.gki-participants-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100000;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.gki-participants-loader {
    position: static;
    transform: none;
    margin: 60px auto;
    max-width: 300px;
}

.gki-loader-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gki-attendance-loader p,
.gki-participants-loader p {
    margin: 0;
    color: #666;
    font-size: 15px;
    font-weight: 500;
}

/* =============================
   No Sessions Message
============================= */
.gki-no-sessions {
    text-align: center;
    padding: 60px 20px;
}

.gki-no-sessions-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.gki-no-sessions h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #333;
}

.gki-no-sessions p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

/* =============================
   Toast Notifications
============================= */
.gki-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 100001;
    transition: bottom 0.3s ease;
    min-width: 280px;
    text-align: center;
}

.gki-toast.show {
    bottom: 30px;
}

/* =============================
   Mobile Optimierungen
============================= */
@media (max-width: 768px) {
    .gki-attendance-content {
        max-width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .gki-attendance-header {
        padding: 20px;
    }
    
    .gki-attendance-header h3 {
        font-size: 18px;
    }
    
    .gki-attendance-body {
        padding: 20px;
    }
    
    .gki-session-card {
        padding: 16px;
    }
    
    .gki-session-time-big {
        font-size: 16px;
    }
    
    .gki-participant-item {
        padding: 14px;
    }
    
    .gki-checkbox-custom {
        width: 28px;
        height: 28px;
    }
    
    /* Größere Touch-Targets auf Mobile */
    .gki-attendance-button {
        width: 56px;
        height: 56px;
    }
}

/* Touch-Optimierung */
@media (hover: none) {
    .gki-session-card:active {
        transform: scale(0.98);
    }
    
    .gki-participant-item:active {
        transform: scale(0.98);
    }
}
/* =============================
   Payment Dropdown - Kompakt
============================= */
.gki-participant-item {
    display: flex !important;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    cursor: pointer !important;
}

.gki-participant-checkbox-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.gki-payment-dropdown-wrapper {
    flex-shrink: 0;
    margin-left: auto;
}

.gki-payment-dropdown {
    padding: 6px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    width: 45px;
    text-align: center;
}

.gki-payment-dropdown:hover:not(:disabled) {
    border-color: #667eea;
    background: #f7f9ff;
}

.gki-payment-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.gki-payment-dropdown:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

/* Visual Feedback: Grün=Bezahlt, Rot=Unbezahlt */
.gki-payment-dropdown[data-current="bar"],
.gki-payment-dropdown[data-current="karte"],
.gki-payment-dropdown[data-current="paypal"] {
    border-color: #10b981 !important;
    background: #ecfdf5 !important;
    color: #065f46 !important;
}

.gki-payment-dropdown[data-current="unbezahlt"] {
    border-color: #ef4444 !important;
    background: #fee2e2 !important;
    color: #991b1b !important;
}

/* Mobile Optimierung */
@media (max-width: 768px) {
    .gki-participant-item {
        flex-wrap: nowrap; /* Bleib in einer Zeile */
    }
    
    .gki-payment-dropdown {
        width: 56px;
        padding: 8px;
        font-size: 15px;
    }
}