/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #000000;
    min-height: 100vh;
    color: #ffffff;
}

/* PIN-Overlay Styles */
.pincode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.pincode-overlay.hidden {
    display: none;
}

/* Shake Animation für falschen PIN */
.pincode-overlay.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.pincode-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.pincode-container h2 {
    color: #1e3a8a;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.pincode-container p {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.pincode-display {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.pincode-dot {
    font-size: 1.5rem;
    color: #334155;
}

.pincode-keypad {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 auto 1rem auto;
    width: 100%;
    max-width: 240px;
}

.pincode-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.pincode-row:last-child {
    justify-content: flex-start;
}

.num-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 1.25rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.num-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.num-btn:active {
    background: #cbd5e1;
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.clear-btn {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-space {
    width: 100%;
    height: 60px;
}

.pincode-status {
    min-height: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.pincode-status.error {
    color: #dc2626;
}

.pincode-status.success {
    color: #059669;
}

/* Hauptcontainer */
.checkin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.checkin-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.checkin-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.checkin-header p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}



/* Checkin-Formular */
.checkin-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    margin: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    gap: 0;
}

/* Bild-Container */
.image-container-top {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    transition: all 0.3s ease; /* Smooth transition für das Ausblenden */
}

.mitmach-image-top {
    width: 30%;
    max-width: none;
    height: auto;
    object-fit: contain;
}

/* Such-Funktion */
.search-container {
    position: relative;
    width: 70vw;
    max-width: none;
}

.search-input {
    width: 100%;
    padding: 2.25rem 3rem;
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    font-size: 2.8125rem; /* 50% größer: 1.875rem * 1.5 = 2.8125rem */
    font-weight: 400;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.search-input:not(:placeholder-shown) {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* Dropdown-Styles */
.customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.25rem;
}

.customer-dropdown-item {
    padding: 1.125rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
    font-size: 1.95rem; /* 30% größer: 1.5rem * 1.3 = 1.95rem */
    color: #000000;
}

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

.customer-dropdown-item:hover {
    background-color: #f8fafc;
}

.customer-dropdown-item:active {
    background-color: #e2e8f0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

/* Token-Status */
.token-status-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 5% auto 2rem auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 70vw;
    max-width: none;
}

.token-status-card {
    text-align: center;
}

.customer-info h3 {
    color: #1e3a8a;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.customer-info p {
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.token-info {
    margin-bottom: 2rem;
}

.token-count, .token-validity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.token-icon, .validity-icon {
    font-size: 1.5rem;
}

.token-text, .validity-text {
    font-size: 1.1rem;
    color: #374151;
    font-weight: 500;
}

#remainingTokens {
    color: #059669;
    font-weight: 700;
    font-size: 1.3rem;
}

#totalTokens {
    color: #1e3a8a;
    font-weight: 600;
}

#expiryDate {
    color: #dc2626;
    font-weight: 600;
}

.checkin-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.checkin-btn {
    width: 100%;
    max-width: none;
    padding: 5.4rem 3rem; /* 20% niedriger: 6.75rem * 0.8 = 5.4rem */
    background: #66dd99;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 2.8125rem; /* 50% größer: 1.875rem * 1.5 = 2.8125rem */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(102, 221, 153, 0.2);
}

.checkin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 221, 153, 0.3);
}

.checkin-btn:active {
    transform: translateY(0);
}

.checkin-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Besuchs-Logs */
.visits-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 0 auto 2rem auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 70vw;
    max-width: none;
}

.visits-card h3 {
    color: #1e3a8a;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.visits-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: none; /* Entfernt Höhenbeschränkung */
    overflow: visible; /* Erlaubt Überlauf */
}

.visit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.visit-date {
    color: #6b7280;
    font-size: 0.9rem;
}

.visit-tokens {
    color: #dc2626;
    font-weight: 600;
}

.visit-remaining {
    color: #059669;
    font-weight: 600;
}

/* Status-Nachrichten */
.status-messages {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
}

.status-message {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #3b82f6;
    animation: slideIn 0.3s ease-out;
    color: #000000;
}

.status-message.success {
    border-left-color: #10b981;
}

.status-message.error {
    border-left-color: #dc2626;
}

.status-message.info {
    border-left-color: #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .checkin-container {
        padding: 1rem;
    }
    
    .checkin-header h1 {
        font-size: 2.5rem;
    }
    
    .checkin-section, .token-status-section, .visits-section {
        padding: 1.5rem;
    }
    
    .checkin-actions {
        flex-direction: column;
    }
    
    .checkin-btn, .reset-btn {
        width: 100%;
    }
    
    .status-messages {
        right: 1rem;
        left: 1rem;
    }
    
    .recharge-modal {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .recharge-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .recharge-modal-actions {
        flex-direction: column;
    }
    
    .recharge-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Recharge Modal */
.recharge-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.recharge-modal-overlay.show {
    opacity: 1;
}

.recharge-modal {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #66dd99;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease-in-out;
    position: relative;
}

.recharge-modal-overlay.show .recharge-modal {
    transform: scale(1);
}

.recharge-modal-header h2 {
    color: #66dd99;
    font-size: 2rem;
    margin: 0 0 1.5rem 0;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(102, 221, 153, 0.3);
}

.recharge-modal-content {
    margin-bottom: 2rem;
}

.recharge-modal-content p {
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.recharge-question {
    font-size: 1.3rem !important;
    font-weight: 600;
    color: #66dd99 !important;
    margin: 1.5rem 0 !important;
}

.recharge-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.recharge-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.recharge-btn-yes {
    background: linear-gradient(135deg, #66dd99 0%, #4ade80 100%);
    color: #000000;
    box-shadow: 0 4px 20px rgba(102, 221, 153, 0.4);
}

.recharge-btn-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 221, 153, 0.6);
}

.recharge-btn-no {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-width: 70px;
    transform: scale(0.5);
    transform-origin: center;
}

/* Modal Close Button */
.modal-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    border-radius: 0 20px 0 0;
    background: #ffffff;
    border: none;
    color: #000000;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: all 0.3s ease;
    z-index: 10000;
}

.modal-close-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Wartesymbol Styles */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 20px 0;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #e9ecef;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-indicator p {
  margin: 0;
  color: #6c757d;
  font-weight: 500;
}

/* Button deaktiviert Zustand */
.recharge-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #6c757d;
}

/* SAFARI/IPAD SPEZIFISCHE OPTIMIERUNGEN */
@media screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 768px) and (max-width: 1024px) {
    .checkin-container {
        padding: 0.25rem !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .checkin-header {
        margin-bottom: 0.25rem !important;
    }
    
    .checkin-header h1 {
        font-size: 1.3rem !important;
        margin-bottom: 0.1rem !important;
        -webkit-text-size-adjust: 100% !important;
    }
    
    .checkin-header p {
        font-size: 0.8rem !important;
        margin-bottom: 0.25rem !important;
        -webkit-text-size-adjust: 100% !important;
    }
    
    .mitmach-image-top {
        width: 25% !important;
        margin: 0 auto 0.25rem auto !important;
        display: block !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .search-container {
        width: 70% !important;
        max-width: 600px !important;
        margin: 0 auto 0.25rem auto !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .search-input {
        padding: 1.5rem 1.5rem !important;
        font-size: 1.5rem !important; /* 50% größer: 1rem * 1.5 = 1.5rem */
        min-height: 60px !important;
        -webkit-appearance: none !important;
        -webkit-border-radius: 0 !important;
        border-radius: 10px !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .checkin-section, .token-status-section, .visits-section {
        padding: 0.25rem !important;
        margin-bottom: 0.25rem !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .token-status-card, .visits-card {
        padding: 0.25rem !important;
        margin-bottom: 0.1rem !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .customer-info h3 {
        font-size: 0.9rem !important;
        margin-bottom: 0.1rem !important;
        -webkit-text-size-adjust: 100% !important;
    }
    
    .customer-info p {
        font-size: 0.75rem !important;
        margin-bottom: 0.1rem !important;
        -webkit-text-size-adjust: 100% !important;
    }
    
    .token-count, .token-validity {
        font-size: 0.7rem !important;
        -webkit-text-size-adjust: 100% !important;
    }
    
    .visits-list {
        max-height: 80px !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .visit-item {
        padding: 0.2rem !important;
        margin-bottom: 0.1rem !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .visit-date {
        font-size: 0.7rem !important;
        -webkit-text-size-adjust: 100% !important;
    }
    
    .visit-location {
        font-size: 0.65rem !important;
        -webkit-text-size-adjust: 100% !important;
    }
    
    .checkin-btn, .reset-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
        -webkit-appearance: none !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .pincode-container {
        max-width: 300px !important;
        padding: 1rem !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .pincode-container h2 {
        font-size: 1.3rem !important;
        margin-bottom: 0.25rem !important;
        -webkit-text-size-adjust: 100% !important;
    }
    
    .num-btn, .clear-btn {
        height: 45px !important;
        font-size: 1rem !important;
        padding: 0.4rem !important;
        -webkit-appearance: none !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .empty-space {
        height: 45px !important;
    }
}
