/* Global styles */
:root {
    --primary-color: #a0b044;
    --secondary-color: #535353;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
    --text-color: #333;
}

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

body {
    font-family: 'Open Sans', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #fff;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: #000;
    border-bottom: 1px solid #333;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

header.white-bg {
    background-color: #fff;
    box-shadow: none;
    border-bottom: none;
    padding: 10px 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 60px;
    width: auto;
    margin-right: 15px;
}

.logo-text h2 {
    color: #fff;
    font-size: 20px;
    font-weight: normal;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    color: inherit;
}

nav ul {
    display: flex;
    list-style: none;
    font-size: 14px;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: 24px;
    background: linear-gradient(90deg, rgba(160,176,68,0.15) 0%, rgba(83,83,83,0.15) 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
}

nav ul li a:hover {
    color: var(--primary-color);
    background: linear-gradient(90deg, rgba(160,176,68,0.30) 0%, rgba(83,83,83,0.25) 100%);
    box-shadow: 0 4px 16px rgba(160,176,68,0.12);
    transform: translateY(-2px) scale(1.04);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #8ca038;
}

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

.btn-secondary:hover {
    background-color: #444;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

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

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

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

/* Alerts */
.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    background-color: rgba(160, 176, 68, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

/* Dropdown Select Styling */
select.form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 30px;
}

select.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(160, 176, 68, 0.25);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

/* Tables */
.partners-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.partners-header .partners-actions {
    display: flex;
    gap: 10px;
}

.partners-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.partners-table th,
.partners-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.partners-table th {
    background-color: var(--light-gray);
    font-weight: 600;
}

.partners-table tr:hover {
    background-color: var(--light-gray);
}

/* Partner images in table */
.partner-image {
    width: 80px;
    text-align: center;
}

.partner-logo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--light-gray);
    border-radius: 8px;
    border: 2px dashed var(--border-color);
    color: var(--secondary-color);
    font-size: 12px;
}

.no-image i {
    font-size: 20px;
    margin-bottom: 4px;
}

.actions {
    display: flex;
    gap: 10px;
}

.no-partners {
    padding: 20px;
    text-align: center;
    background-color: var(--light-gray);
    border-radius: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.modal p {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

/* Partner form */
.partner-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.partner-form-container h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Image upload field */
.current-image {
    margin-top: 10px;
    padding: 15px;
    background-color: var(--light-gray);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.current-image p {
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--secondary-color);
}

.current-image img {
    display: block;
    margin-bottom: 8px;
}

.image-filename {
    font-family: monospace;
    font-size: 12px;
    color: var(--secondary-color);
    background-color: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: inline-block;
}

.form-hint {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 5px;
    font-style: italic;
}

.partner-code-display {
    padding: 15px;
    background-color: var(--light-gray);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.partner-code-display .code-value {
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    color: var(--primary-color);
    display: inline-block;
    margin-bottom: 0;
}

.btn-small {
    padding: 8px 12px;
    font-size: 14px;
    min-width: auto;
}

.btn-small i {
    font-size: 12px;
    margin-right: 4px;
}

.partner-code-display .form-hint {
    margin-top: 0;
}

/* Rich text editor */
.rich-text-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}

.toolbar-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

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

.toolbar-btn:active {
    transform: translateY(1px);
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
    margin: 0 5px;
}

.rich-text-editor {
    min-height: 150px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 4px 4px;
    background-color: white;
    overflow-y: auto;
    line-height: 1.6;
}

.rich-text-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(160, 176, 68, 0.2);
}

.rich-text-editor h1,
.rich-text-editor h2,
.rich-text-editor h3,
.rich-text-editor h4,
.rich-text-editor h5,
.rich-text-editor h6 {
    margin: 16px 0 8px 0;
    color: var(--secondary-color);
    font-weight: 600;
}

.rich-text-editor h3 {
    font-size: 18px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 4px;
}

.rich-text-editor ul,
.rich-text-editor ol {
    margin: 8px 0;
    padding-left: 24px;
}

.rich-text-editor li {
    margin: 4px 0;
}

.rich-text-editor p {
    margin: 8px 0;
}

.rich-text-editor a {
    color: var(--primary-color);
    text-decoration: underline;
}

.rich-text-editor a:hover {
    color: var(--secondary-color);
}



/* QR Code */
.qrcode-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.qrcode-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.qrcode-logo {
    width: auto;
    margin-bottom: 0px;
}

.qrcode-header h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin: 0;
}

.qrcode-display {
    margin: 30px 0;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.qrcode-display img {
    max-width: 250px;
    height: auto;
}

.reader-id {
    margin-top: 15px;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Partner Code Display */
.partner-code-section {
    margin: 30px 0;
    padding: 25px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed var(--primary-color);
}

.code-label {
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.partner-code {
    font-size: 48px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    color: var(--primary-color);
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    display: inline-block;
    margin: 10px 0;
    border: 2px solid var(--primary-color);
}

.code-hint {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

.qrcode-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Footer */
footer {
    background-color: var(--light-gray);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
}

/* Print styles */
@media print {
    header, footer, .qrcode-actions {
        display: none;
    }

    .qrcode-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .qrcode-display {
        box-shadow: none;
        border: none;
    }

    .partner-code-section {
        page-break-inside: avoid;
        border: 2px solid var(--primary-color);
    }
} 

/* Checkin-Styles --------------------------------------------- */

/* QR Scanner */
#scanner-container {
    text-align: center;
    width: 100%;
}

#qrcode-scanner-video {
    width: 320px;
    max-height: 320px;
    margin-right: 20px;
    margin-left: 20px;
    border-radius: 8px;
}

#output {
    margin: 00px 0;
    padding: 15px;
    font-size: 16px;
    min-height: 50px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Code Input Alternative */
#code-input-container {
    text-align: center;
    padding: 20px;
    max-width: 420px;
    margin: 0 auto;
}

.code-input-header h3 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.code-input-header p {
    color: var(--secondary-color);
    font-size: 16px;
    margin-bottom: 20px;
}

#code-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

#partner-code-input {
    width: 200px;
    padding: 20px;
    font-size: 32px;
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    text-align: center;
    text-transform: uppercase;
    border: 3px solid var(--primary-color);
    border-radius: 8px;
    background-color: white;
    color: var(--primary-color);
    font-weight: bold;
}

#partner-code-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(160, 176, 68, 0.3);
}

#submit-code-btn {
    padding: 15px 30px;
    font-size: 18px;
    min-width: 200px;
}

.error-message {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

/* Toggle Button */
#toggle-container {
    text-align: center;
    margin-top: 0px;
    padding: 10px;
}

#toggle-mode-btn {
    padding: 12px 25px;
    font-size: 16px;
    min-width: 200px;
}

.clubconn_base {
    width: 100vw;
    max-width: none;
    text-align: center;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.clubconn_base .tsc-logo-checkin {
   margin-top: 20px;   
   
}

.checkin-success {
    background: #35D24F;
    padding: 20px;
    text-align: center;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 40px;
    margin: 0;
    box-sizing: border-box;
}

.success-icon {
    margin-top: 0px;
    margin-bottom: 0px;
}

.success-icon svg {
    width: 80px;
    height: 80px;
}

.success-content {
    width: 100%;
    max-width: 400px;
}

.success-content h2 {
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    margin-top: 0px;
    /*text-shadow: 0 1px 3px rgba(0,0,0,0.2);*/
}

.member-photo {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    background-color: rgb(250, 250, 250);
    border-radius: 8px;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.member-photo img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 4px solid #ffffff;
    box-shadow: none;
    box-sizing: border-box;
    display: block;
}

/* removed member-photo-caption since text is rendered within placeholder image */

.member-info {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: left;
}

.info-item {
    margin-bottom: 15px;
    font-size: 13px;
    line-height: 1.1;
    display: flex;
    align-items: flex-start;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: bold;
    color: #333;
    min-width: 120px;
    flex-shrink: 0;
}

/* Value part that can wrap */
.info-item .info-label + * {
    flex: 1;
    text-align: left;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    margin-left: 0;
}

.checkin-failed {
    background: #dc3545;
    padding: 20px;
    text-align: center;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 40px;
    margin: 0;
    box-sizing: border-box;
}

.error-icon {
    margin-bottom: 0px;
}

.error-icon svg {
    width: 80px;
    height: 80px;
}

.error-content {
    width: 100%;
    max-width: 400px;
}

.error-content h2 {
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    margin-top: 0px;
}

.error-info {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: left;
    margin-bottom: 20px;
}

.checkin-actions {
    text-align: center;
}

.btn-retry {
    background-color: #fff;
    color: #dc3545;
    border: 2px solid #dc3545;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background-color: #dc3545;
    color: white;
}

.clubconn_base h2 {
    font-size: 22px;
    color: #000;
    padding-top: 20px;
}

.member-data {
    margin: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    word-break: break-all; 
}


/* styles fuer schimmerndes Logo */
@keyframes hueCycle {
    from { filter: hue-rotate(0deg); }   /* Ausgangsfarbton            */
    to   { filter: hue-rotate(360deg); } /* kompletter 360-Grad-Loop   */
  }
  
  .badge-live {
    display: inline-block;
    animation: hueCycle 3s linear infinite;   /* 6-Sekunden-Zyklus        */
  }
  
  /* Bewegungs­-Reduktion respektieren */
  @media (prefers-reduced-motion: reduce) {
    .badge-live { animation: none; }
  }

/* Loading Spinner für QR-Code Überprüfung */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.loading-message {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: pulse 1.5s ease-in-out infinite;
    border-top-color: var(--primary-color);
  }
}
