/* ===== TVB MEMBERSHIP REGISTRATION ===== */

/* Container */
.tvb-membership-container {
    max-width: 700px;
    margin: 0 auto;
    font-family: inherit;
}

/* Type Selection Cards */
.tvb-membership-intro {
    font-size: 1.1em;
    margin-bottom: 1.5em;
    text-align: center;
}

.tvb-type-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;
    margin-bottom: 2em;
}

.tvb-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    padding: 2em 1.5em;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.tvb-type-card:hover {
    border-color: var(--tvb-red, #be1a2a);
    box-shadow: 0 4px 12px rgba(190, 26, 42, 0.15);
    transform: translateY(-2px);
}

.tvb-type-card i {
    font-size: 2.5em;
    color: var(--tvb-red, #be1a2a);
}

.tvb-type-card-title {
    font-size: 1.1em;
    font-weight: 600;
}

.tvb-type-card-desc {
    font-size: 0.85em;
    color: #666;
}

/* Step Indicator */
.tvb-membership-steps {
    display: flex;
    gap: 0;
    margin-bottom: 2em;
    overflow-x: auto;
    border-bottom: 2px solid #e0e0e0;
}

.tvb-step {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.75em 1em;
    font-size: 0.85em;
    color: #999;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tvb-step.active {
    color: var(--tvb-red, #be1a2a);
    border-bottom-color: var(--tvb-red, #be1a2a);
    font-weight: 600;
}

.tvb-step.completed {
    color: #28a745;
    border-bottom-color: #28a745;
}

.tvb-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8em;
    font-weight: 700;
    background: #e0e0e0;
    color: #666;
}

.tvb-step.active .tvb-step-number {
    background: var(--tvb-red, #be1a2a);
    color: #fff;
}

.tvb-step.completed .tvb-step-number {
    background: #28a745;
    color: #fff;
}

/* Form Groups */
.tvb-membership-form-container .tvb-form-group {
    margin-bottom: 1em;
}

.tvb-membership-form-container label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.3em;
    font-size: 0.95em;
}

.tvb-membership-form-container input[type="text"],
.tvb-membership-form-container input[type="email"],
.tvb-membership-form-container input[type="tel"],
.tvb-membership-form-container select,
.tvb-membership-form-container textarea {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tvb-membership-form-container input:focus,
.tvb-membership-form-container select:focus,
.tvb-membership-form-container textarea:focus {
    border-color: var(--tvb-red, #be1a2a);
    outline: none;
    box-shadow: 0 0 0 2px rgba(190, 26, 42, 0.1);
}

.tvb-form-row {
    display: flex;
    gap: 1em;
}

.tvb-field-small {
    flex: 0 0 120px;
}

.tvb-field-large {
    flex: 1;
}

.required {
    color: var(--tvb-red, #be1a2a);
}

.tvb-hint {
    font-size: 0.85em;
    color: #666;
    margin-top: 0.3em;
}

.tvb-hint i {
    color: var(--tvb-red, #be1a2a);
}

/* Checkbox Labels */
.tvb-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    cursor: pointer;
    font-weight: 400;
    line-height: 1.4;
}

.tvb-checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 0.2em;
    flex-shrink: 0;
}

.tvb-checkbox-grid {
    display: grid;
    gap: 0.5em;
    margin: 0.5em 0 1.5em;
    padding-left: 0.5em;
}

.tvb-checkbox-all {
    border-top: 1px solid #e0e0e0;
    padding-top: 0.5em;
    margin-top: 0.5em;
}

/* Radio Cards */
.tvb-radio-cards {
    display: grid;
    gap: 0.5em;
}

.tvb-radio-card label {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.8em 1em;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 400;
}

.tvb-radio-card label:hover {
    border-color: var(--tvb-red, #be1a2a);
}

.tvb-radio-card input[type="radio"]:checked + .tvb-radio-card-content {
    color: var(--tvb-red, #be1a2a);
}

.tvb-radio-card:has(input:checked) label {
    border-color: var(--tvb-red, #be1a2a);
    background: rgba(190, 26, 42, 0.03);
}

.tvb-radio-card-content {
    display: flex;
    flex-direction: column;
}

.tvb-radio-card-content strong {
    font-size: 0.95em;
}

.tvb-radio-card-content small {
    font-size: 0.8em;
    color: #666;
}

/* Fee Summary */
.tvb-fee-summary {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1em 1.2em;
    margin-top: 1em;
}

.tvb-fee-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4em 0;
}

.tvb-fee-item + .tvb-fee-item {
    border-top: 1px solid #e0e0e0;
}

/* SEPA */
.tvb-sepa-mandate {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1em 1.2em;
    margin: 1em 0;
    font-size: 0.9em;
    line-height: 1.5;
}

.tvb-iban-status {
    margin-top: 0.3em;
    font-size: 0.85em;
}

.tvb-valid {
    color: #28a745;
}

.tvb-invalid {
    color: #dc3545;
}

/* Summary */
.tvb-summary-section {
    margin-bottom: 1.5em;
}

.tvb-summary-section h4 {
    color: var(--tvb-red, #be1a2a);
    border-bottom: 2px solid var(--tvb-red, #be1a2a);
    padding-bottom: 0.3em;
    margin-bottom: 0.5em;
    font-size: 1em;
}

.tvb-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.tvb-summary-table td {
    padding: 0.4em 0.5em;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.tvb-summary-table td:first-child {
    font-weight: 500;
    width: 40%;
    color: #555;
}

.tvb-summary-info {
    background: #e8f4fd;
    border: 1px solid #b6d4e8;
    border-radius: 8px;
    padding: 1em;
    margin-top: 1em;
    font-size: 0.9em;
}

.tvb-summary-info i {
    color: #2196F3;
}

/* Navigation */
.tvb-membership-nav {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #e0e0e0;
}

.tvb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.7em 1.5em;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    text-decoration: none;
}

.tvb-btn-primary {
    background: var(--tvb-red, #be1a2a);
    color: #fff;
}

.tvb-btn-primary:hover {
    background: var(--tvb-red-dark, #9a0f22);
}

.tvb-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tvb-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.tvb-btn-secondary:hover {
    background: #e0e0e0;
}

/* Messages */
.tvb-membership-message {
    padding: 0.8em 1em;
    border-radius: 6px;
    margin-top: 1em;
    font-size: 0.9em;
}

.tvb-membership-message.tvb-error {
    background: #fce4e4;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.tvb-membership-message.tvb-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Success/Error Pages */
.tvb-membership-message-page {
    text-align: center;
    padding: 3em 2em;
    max-width: 600px;
    margin: 0 auto;
}

.tvb-membership-message-page i {
    font-size: 3em;
    margin-bottom: 0.3em;
}

.tvb-membership-message-page.tvb-success i {
    color: #28a745;
}

.tvb-membership-message-page.tvb-error i {
    color: #dc3545;
}

.tvb-membership-message-page h3 {
    margin: 0.5em 0;
}

/* Contact Info */
.tvb-membership-contact {
    text-align: center;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9em;
    color: #666;
}

.tvb-membership-contact a {
    color: var(--tvb-red, #be1a2a);
}

/* Parent2 Consent */
.tvb-parent2-loading {
    text-align: center;
    padding: 3em;
    font-size: 1.2em;
    color: #666;
}

/* ===== FEES TABLE (Shortcode) ===== */
.tvb-fees-table-container {
    max-width: 900px;
    margin: 0 auto;
}

.tvb-fees-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.tvb-fees-table thead th {
    background: var(--tvb-red, #be1a2a);
    color: #fff;
    padding: 0.7em 0.8em;
    text-align: left;
    font-size: 0.9em;
}

.tvb-fees-table thead th:first-child {
    border-radius: 6px 0 0 0;
}

.tvb-fees-table thead th:last-child {
    border-radius: 0 6px 0 0;
}

.tvb-fees-table tbody td {
    padding: 0.6em 0.8em;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95em;
}

.tvb-fees-table tbody tr:last-child td {
    border-bottom: 2px solid var(--tvb-red, #be1a2a);
}

.tvb-fees-table tbody tr:hover {
    background: rgba(190, 26, 42, 0.03);
}

.tvb-fees-note {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    margin-top: 0.5em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Fees table: card layout on mobile */
    .tvb-fees-table thead {
        display: none;
    }
    .tvb-fees-table,
    .tvb-fees-table tbody,
    .tvb-fees-table tr,
    .tvb-fees-table td {
        display: block;
        width: 100%;
    }
    .tvb-fees-table tr {
        margin-bottom: 1em;
        padding: 0.8em;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        border-left: 4px solid var(--tvb-red, #be1a2a);
    }
    .tvb-fees-table td {
        padding: 0.3em 0;
        border-bottom: none;
        font-size: 0.9em;
    }
    .tvb-fees-table td:first-child {
        font-weight: 700;
        font-size: 1em;
        color: var(--tvb-red, #be1a2a);
        margin-bottom: 0.3em;
    }
    .tvb-fees-table td:not(:first-child)::before {
        font-weight: 500;
        color: #666;
        margin-right: 0.3em;
    }
    .tvb-fees-table td:nth-child(2)::before { content: "Jährlich: "; }
    .tvb-fees-table td:nth-child(3)::before { content: "Halbjährlich: "; }
    .tvb-fees-table td:nth-child(4)::before { content: "Vierteljährlich: "; }
    .tvb-fees-table td:nth-child(5)::before { content: "Aufnahmegebühr: "; }
    .tvb-fees-table tbody tr:last-child td {
        border-bottom: none;
    }
}

@media (max-width: 600px) {
    .tvb-type-cards {
        grid-template-columns: 1fr;
    }

    .tvb-form-row {
        flex-direction: column;
        gap: 0;
    }

    .tvb-field-small,
    .tvb-field-large {
        flex: auto;
    }

    .tvb-membership-steps {
        gap: 0;
        font-size: 0.8em;
    }

    .tvb-step-title {
        display: none;
    }

    .tvb-membership-nav {
        flex-direction: column;
    }

    .tvb-fee-item {
        flex-direction: column;
        gap: 0.2em;
    }
}

/* ===== ADMIN STYLES ===== */

.tvb-membership-admin h1 .dashicons {
    vertical-align: middle;
    margin-right: 0.3em;
}

/* Tabs */
.tvb-membership-tabs {
    display: flex;
    gap: 0;
    margin: 1em 0;
    border-bottom: 2px solid #e0e0e0;
}

.tvb-tab {
    padding: 0.6em 1em;
    text-decoration: none;
    color: #555;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tvb-tab:hover {
    color: #333;
}

.tvb-tab.active {
    color: var(--tvb-red, #be1a2a);
    border-bottom-color: var(--tvb-red, #be1a2a);
    font-weight: 600;
}

.tvb-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e0e0e0;
    font-size: 0.8em;
    margin-left: 0.3em;
}

.tvb-tab.active .tvb-tab-count {
    background: var(--tvb-red, #be1a2a);
    color: #fff;
}

/* Actions */
.tvb-membership-actions {
    margin: 1em 0;
}

/* Scrollable Table Wrapper */
.tvb-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 1em;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.tvb-table-scroll table {
    border: none;
    margin: 0;
    min-width: 700px;
}

/* Auto layout, table stretches beyond container → scroll wrapper handles it */
.tvb-membership-table,
.tvb-consent-table {
    table-layout: auto !important;
}

.tvb-membership-table th,
.tvb-membership-table td,
.tvb-consent-table th,
.tvb-consent-table td {
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
}

/* Column hints */
.tvb-col-id { min-width: 50px; text-align: center; }
.tvb-col-name { min-width: 120px; }
.tvb-col-date { min-width: 85px; }
.tvb-col-check { min-width: 40px; text-align: center; }
.tvb-col-consent { min-width: 60px; text-align: center; }
.tvb-col-status { min-width: 90px; }
.tvb-col-actions { min-width: 55px; }
.tvb-col-photo { min-width: 50px; text-align: center; }

/* List columns: use inner div to force wrapping in auto-layout tables */
.tvb-col-list {
    min-width: 150px;
}
.tvb-cell-wrap {
    max-width: 200px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    font-size: 12px;
}

/* Copyable ID */
.tvb-copyable {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    user-select: all;
}
.tvb-copyable:hover {
    background: #d0d0d0;
}
.tvb-copied-tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    pointer-events: none;
    z-index: 10000;
}

/* Consent photo thumbnail */
.tvb-consent-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
}
.tvb-photo-wrap {
    position: relative;
    display: inline-block;
}
.tvb-photo-wrap .tvb-photo-actions {
    display: none;
    position: absolute;
    top: -4px;
    right: -20px;
    gap: 2px;
    flex-direction: column;
}
.tvb-photo-wrap:hover .tvb-photo-actions {
    display: flex;
}
.tvb-photo-actions button {
    border: none;
    background: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.tvb-photo-actions button:hover {
    background: #f0f0f1;
}

/* Table */
.tvb-membership-table .tvb-actions {
    white-space: nowrap;
}

.tvb-membership-table .tvb-actions .button {
    margin-right: 3px;
}

.tvb-membership-table .tvb-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Badges */
.tvb-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
}

.tvb-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.tvb-badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.tvb-badge-success {
    background: #d4edda;
    color: #155724;
}

.tvb-badge-primary {
    background: #cce5ff;
    color: #004085;
}

.tvb-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.tvb-badge-muted {
    background: #e9ecef;
    color: #6c757d;
}

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

.tvb-modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 2em;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.tvb-modal-large {
    max-width: 800px;
}

.tvb-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.tvb-modal-close:hover {
    color: #333;
}

/* Detail Table */
.tvb-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.tvb-detail-table td {
    padding: 0.4em 0.5em;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.tvb-detail-table td:first-child {
    font-weight: 500;
    width: 40%;
    color: #555;
}

/* Form Actions */
.tvb-form-actions {
    margin-top: 1em;
}

/* Confirm Message */
#confirm-message {
    padding: 0.6em 1em;
    border-radius: 4px;
    margin-top: 1em;
    font-size: 0.9em;
}

#confirm-message.tvb-success {
    background: #d4edda;
    color: #155724;
}

#confirm-message.tvb-error {
    background: #f8d7da;
    color: #721c24;
}

/* Confirm Modal Grid */
.tvb-confirm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8em 1.5em;
}

.tvb-confirm-grid .tvb-form-group {
    margin-bottom: 0;
}

.tvb-confirm-grid label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9em;
    color: #333;
}

.tvb-confirm-grid input[type="text"],
.tvb-confirm-grid .regular-text {
    width: 100%;
    max-width: 100%;
    padding: 6px 8px;
    font-size: 0.95em;
}

.tvb-confirm-grid .description {
    font-size: 0.8em;
    margin-top: 3px;
}

@media (max-width: 768px) {
    .tvb-confirm-grid {
        grid-template-columns: 1fr;
    }
}

/* Spin animation for dashicons */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}
