/**
 * TVB Event Registration Block - Modern Sports Club Design
 * Clean, professional layout with athletic energy
 */

/* === TYPOGRAPHY === */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&display=swap');

/* === VARIABLES === */
:root {
    --tvb-red: #be1a2a;
    --tvb-red-dark: #9a0f22;
    --tvb-gray-50: #f8f9fa;
    --tvb-gray-100: #e9ecef;
    --tvb-gray-200: #dee2e6;
    --tvb-gray-600: #6c757d;
    --tvb-gray-800: #343a40;
    --tvb-success: #28a745;
    --tvb-warning: #ffc107;
}

/* === MAIN CONTAINER === */
.tvb-event-registration {
    font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--tvb-gray-800);
    line-height: 1.6;
}

/* Event header is shown by shortcode - block just shows forms */

/* === PIN FORM SECTION === */
.tvb-event-pin-form {
    max-width: 680px;
    margin: 40px auto;
    background: #ffffff;
    border: 2px solid var(--tvb-gray-200);
    border-radius: 12px;
    padding: 40px;
}

.tvb-event-pin-form h3 {
    font-family: 'Barlow', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--tvb-red);
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.tvb-event-pin-form > p {
    color: var(--tvb-gray-600);
    margin: 0 0 28px 0;
    font-size: 16px;
}

/* === REGISTRATION FORM === */
.tvb-event-registration-form {
    max-width: 680px;
    margin: 40px auto;
    background: #ffffff;
    border: 2px solid var(--tvb-gray-200);
    border-radius: 12px;
    padding: 40px;
}

.tvb-event-registration-form h3 {
    font-family: 'Barlow', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--tvb-red);
    margin: 0 0 28px 0;
    letter-spacing: -0.02em;
}

/* === FORM GROUPS === */
.tvb-form-group {
    margin-bottom: 24px;
}

.tvb-form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--tvb-gray-800);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tvb-form-group .required {
    color: var(--tvb-red);
    font-weight: 700;
}

.tvb-form-group input[type="text"],
.tvb-form-group input[type="email"],
.tvb-form-group select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: 'Barlow', sans-serif;
    border: 2px solid var(--tvb-gray-200);
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
    color: var(--tvb-gray-800);
}

.tvb-form-group input:focus,
.tvb-form-group select:focus {
    outline: none;
    border-color: var(--tvb-red);
    box-shadow: 0 0 0 3px rgba(190, 26, 42, 0.1);
}

.tvb-form-group input::placeholder {
    color: var(--tvb-gray-600);
    opacity: 0.6;
}

.tvb-form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23343a40' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

/* === BUTTONS === */
.tvb-btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Barlow', sans-serif;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.tvb-btn-primary {
    background: var(--tvb-red);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(190, 26, 42, 0.25);
}

.tvb-btn-primary:hover:not(:disabled) {
    background: var(--tvb-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(190, 26, 42, 0.35);
}

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

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

/* === MESSAGES === */
.tvb-pin-message,
.tvb-registration-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
}

.tvb-pin-message.success,
.tvb-registration-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: #1e7e34;
    border: 2px solid rgba(40, 167, 69, 0.3);
}

.tvb-pin-message.error,
.tvb-registration-message.error {
    background: rgba(190, 26, 42, 0.1);
    color: var(--tvb-red-dark);
    border: 2px solid rgba(190, 26, 42, 0.3);
}

/* === PIN HELP === */
.tvb-pin-help {
    margin-top: 28px;
    padding: 20px;
    background: var(--tvb-gray-50);
    border-left: 4px solid var(--tvb-red);
    border-radius: 0 8px 8px 0;
}

.tvb-pin-help .help-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--tvb-gray-600);
}

.tvb-pin-help .help-text i {
    color: var(--tvb-red);
    margin-right: 8px;
}

.tvb-pin-help strong {
    color: var(--tvb-gray-800);
    font-weight: 700;
}

.tvb-pin-help a {
    color: var(--tvb-red);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.tvb-pin-help a:hover {
    color: var(--tvb-red-dark);
    text-decoration: underline;
}

/* === EDITOR STYLES === */
.tvb-event-registration-editor {
    padding: 30px;
    background: var(--tvb-gray-50);
    border: 2px dashed var(--tvb-gray-200);
    border-radius: 12px;
    text-align: center;
    color: var(--tvb-gray-600);
}

/* === FORGOT PIN LINK === */
.tvb-forgot-pin-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    color: var(--tvb-red);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.tvb-forgot-pin-link:hover {
    color: var(--tvb-red-dark);
    text-decoration: underline;
}

/* === MODAL === */
.tvb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}

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

.tvb-modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.tvb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 32px;
    border-bottom: 2px solid var(--tvb-gray-100);
}

.tvb-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--tvb-red);
    font-family: 'Barlow', sans-serif;
}

.tvb-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--tvb-gray-600);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tvb-modal-close:hover {
    background: var(--tvb-gray-100);
    color: var(--tvb-gray-800);
}

.tvb-modal-body {
    padding: 32px;
}

.tvb-modal-body p {
    margin: 0 0 24px 0;
    line-height: 1.7;
    color: var(--tvb-gray-600);
}

.tvb-resend-pin-form .tvb-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: 'Barlow', sans-serif;
    border: 2px solid var(--tvb-gray-200);
    border-radius: 8px;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

.tvb-resend-pin-form .tvb-input:focus {
    outline: none;
    border-color: var(--tvb-red);
    box-shadow: 0 0 0 3px rgba(190, 26, 42, 0.1);
}

.tvb-resend-pin-form .tvb-btn {
    width: 100%;
}

/* === EDIT MODE === */
.tvb-edit-mode-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 28px;
    border-radius: 12px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.tvb-edit-mode-banner p {
    margin: 0 0 12px 0;
    line-height: 1.7;
}

.tvb-edit-mode-banner p:last-child {
    margin-bottom: 0;
}

.tvb-edit-mode-banner strong {
    font-weight: 700;
}

.tvb-edit-mode-banner em {
    font-style: normal;
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.tvb-edit-hint {
    font-size: 14px;
    opacity: 0.95;
}

.tvb-edit-mode-pin-form {
    max-width: 500px;
    margin: 0 auto 32px;
    padding: 36px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--tvb-gray-100);
}

.tvb-edit-mode-pin-form h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--tvb-gray-800);
    margin: 0 0 20px 0;
    font-family: 'Barlow', sans-serif;
}

.tvb-edit-mode-pin-form .tvb-pin-help {
    margin: 16px 0 0 0;
    padding: 0;
    background: none;
    border: none;
    text-align: center;
}

.tvb-edit-mode-pin-form .tvb-forgot-personal-pin-link {
    color: var(--tvb-red);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tvb-edit-mode-pin-form .tvb-forgot-personal-pin-link:hover {
    color: var(--tvb-red-dark);
    text-decoration: underline;
}

/* === DELETE BUTTON === */
.tvb-btn-danger {
    background: #dc3545;
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.tvb-btn-danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.35);
}

/* === ERROR STATE === */
.tvb-event-registration-error {
    padding: 24px;
    background: rgba(190, 26, 42, 0.05);
    border: 2px solid rgba(190, 26, 42, 0.2);
    border-radius: 12px;
    color: var(--tvb-red-dark);
    text-align: center;
    margin: 32px 0;
}

.tvb-event-registration-error p {
    margin: 0;
    font-weight: 500;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .tvb-event-registration {
        padding: 0 16px;
    }

    .tvb-event-pin-form,
    .tvb-event-registration-form {
        padding: 28px 24px;
        margin: 24px 0;
    }

    .tvb-event-pin-form h3,
    .tvb-event-registration-form h3 {
        font-size: 24px;
    }

    .tvb-btn {
        width: 100%;
        padding: 16px 24px;
    }

    .tvb-modal {
        margin: 16px;
    }

    .tvb-modal-header {
        padding: 20px 24px;
    }

    .tvb-modal-body {
        padding: 24px;
    }

    .tvb-edit-mode-pin-form {
        padding: 24px 20px;
    }
}

/* === ANIMATIONS === */
@media (prefers-reduced-motion: no-preference) {
    .tvb-form-group input,
    .tvb-form-group select {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .tvb-btn {
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
