/*!
 * BP Ticket Verify – Frontend Styles
 *
 * Dark theme with accent colour (#00FFAE).
 * CSS custom properties are injected dynamically from admin settings
 * via wp_add_inline_style on the :root selector.
 *
 * @package BP_Ticket_Verify
 * @since   1.1.0
 */

/* ------------------------------------------------------------------
 * CSS Custom Property Defaults
 * (overridden by inline styles from admin settings)
 * ----------------------------------------------------------------*/
:root {
    --bp-tv-primary: #000000;
    --bp-tv-accent: #00FFAE;
    --bp-tv-text: #FFFFFF;
    --bp-tv-card-bg: #111111;
    --bp-tv-radius: 12px;
    --bp-tv-error: #ff4757;
    --bp-tv-gray: #1a1a1a;
    --bp-tv-gray-light: #222222;
    --bp-tv-gray-mid: #333333;
    --bp-tv-transition: 0.25s ease;
}

/* ------------------------------------------------------------------
 * Wrapper
 * ----------------------------------------------------------------*/
.bp-tv-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    min-height: 60vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--bp-tv-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------------
 * Card
 * ----------------------------------------------------------------*/
.bp-tv-card {
    width: 100%;
    max-width: 560px;
    background: var(--bp-tv-card-bg);
    border-radius: var(--bp-tv-radius);
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    border: 1px solid var(--bp-tv-gray-light);
}

/* ------------------------------------------------------------------
 * Logo
 * ----------------------------------------------------------------*/
.bp-tv-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.bp-tv-logo-text {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--bp-tv-accent);
    display: inline-block;
    padding: 0.35rem 1rem;
    border: 1px solid var(--bp-tv-accent);
    border-radius: 4px;
}

/* ------------------------------------------------------------------
 * Headings
 * ----------------------------------------------------------------*/
.bp-tv-heading {
    text-align: center;
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--bp-tv-text);
    line-height: 1.3;
}

.bp-tv-heading-valid {
    color: var(--bp-tv-accent);
}

.bp-tv-heading-invalid {
    color: var(--bp-tv-error);
}

/* ------------------------------------------------------------------
 * Description
 * ----------------------------------------------------------------*/
.bp-tv-description {
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 1.75rem;
}

/* ------------------------------------------------------------------
 * Steps
 * ----------------------------------------------------------------*/
.bp-tv-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.bp-tv-step {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    background: var(--bp-tv-gray);
    border-radius: calc(var(--bp-tv-radius) * 0.65);
    border: 1px solid var(--bp-tv-gray-light);
}

.bp-tv-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bp-tv-accent);
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
}

.bp-tv-step-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

/* ------------------------------------------------------------------
 * Form Steps (Two-step flow)
 * ----------------------------------------------------------------*/
.bp-tv-form-step {
    /* Steps are toggled via JS display property */
}

.bp-tv-step-active {
    display: block;
}

/* ------------------------------------------------------------------
 * Form
 * ----------------------------------------------------------------*/
.bp-tv-form {
    margin-bottom: 1rem;
}

.bp-tv-input-group {
    margin-bottom: 1rem;
}

.bp-tv-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.45rem;
}

.bp-tv-input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    color: var(--bp-tv-text);
    background: var(--bp-tv-gray);
    border: 1px solid var(--bp-tv-gray-mid);
    border-radius: calc(var(--bp-tv-radius) * 0.65);
    outline: none;
    transition: border-color var(--bp-tv-transition);
    box-sizing: border-box;
    font-family: inherit;
}

.bp-tv-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.bp-tv-input:focus {
    border-color: var(--bp-tv-accent);
    box-shadow: 0 0 0 3px rgba(0, 255, 174, 0.15);
}

/* ------------------------------------------------------------------
 * Code Input (large centered digits)
 * ----------------------------------------------------------------*/
.bp-tv-code-input {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5em;
    padding: 0.85rem 1rem;
    font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
    color: var(--bp-tv-accent);
    background: var(--bp-tv-gray);
    border: 2px solid var(--bp-tv-gray-mid);
    caret-color: var(--bp-tv-accent);
}

.bp-tv-code-input:focus {
    border-color: var(--bp-tv-accent);
    box-shadow: 0 0 0 3px rgba(0, 255, 174, 0.15);
}

.bp-tv-code-input::placeholder {
    color: rgba(255, 255, 255, 0.15);
    letter-spacing: 0.3em;
    font-size: 1.8rem;
}

/* ------------------------------------------------------------------
 * Code Sent Message
 * ----------------------------------------------------------------*/
.bp-tv-code-sent-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    background: rgba(0, 255, 174, 0.08);
    border: 1px solid rgba(0, 255, 174, 0.2);
    border-radius: calc(var(--bp-tv-radius) * 0.65);
    font-size: 0.88rem;
    color: var(--bp-tv-accent);
    text-align: center;
    line-height: 1.5;
}

/* ------------------------------------------------------------------
 * Code Actions (resend / back)
 * ----------------------------------------------------------------*/
.bp-tv-code-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.bp-tv-link-btn {
    background: none;
    border: none;
    color: var(--bp-tv-accent);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity var(--bp-tv-transition);
}

.bp-tv-link-btn:hover {
    opacity: 0.8;
}

.bp-tv-code-separator {
    color: rgba(255, 255, 255, 0.25);
}

.bp-tv-resend-timer {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.bp-tv-code-help {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 1rem 0 0;
    line-height: 1.5;
}

/* ------------------------------------------------------------------
 * Buttons
 * ----------------------------------------------------------------*/
.bp-tv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: calc(var(--bp-tv-radius) * 0.65);
    transition: all var(--bp-tv-transition);
    text-decoration: none;
    line-height: 1;
}

.bp-tv-btn-primary {
    width: 100%;
    background: var(--bp-tv-accent);
    color: #000;
}

.bp-tv-btn-primary:hover {
    background: #33ffbe;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(0, 255, 174, 0.3);
}

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

.bp-tv-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Copy button */
.bp-tv-btn-copy {
    background: var(--bp-tv-accent);
    color: #000;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.bp-tv-btn-copy:hover {
    background: #33ffbe;
}

.bp-tv-btn-copy.copied {
    background: #33ffbe;
    animation: bp-tv-pulse 0.3s ease;
}

@keyframes bp-tv-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* Spinner inside button */
.bp-tv-spinner {
    display: inline-flex;
    align-items: center;
}

.bp-tv-spinner svg {
    display: block;
}

/* ------------------------------------------------------------------
 * Messages
 * ----------------------------------------------------------------*/
.bp-tv-message {
    padding: 1rem 1.25rem;
    border-radius: calc(var(--bp-tv-radius) * 0.65);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 1rem;
}

.bp-tv-message-error {
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid rgba(255, 71, 87, 0.35);
    color: #ff6b7a;
}

/* ------------------------------------------------------------------
 * Success / Result Box (on verify form page)
 * ----------------------------------------------------------------*/
.bp-tv-result-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bp-tv-gray);
    border: 1px solid var(--bp-tv-accent);
    border-radius: var(--bp-tv-radius);
}

.bp-tv-result-intro {
    font-size: 0.95rem;
    color: var(--bp-tv-accent);
    font-weight: 600;
    margin: 0 0 1rem;
}

.bp-tv-link-box {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.bp-tv-link-input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    color: var(--bp-tv-text);
    background: var(--bp-tv-card-bg);
    border: 1px solid var(--bp-tv-gray-mid);
    border-radius: calc(var(--bp-tv-radius) * 0.5);
    outline: none;
    font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
    box-sizing: border-box;
    min-width: 0;
}

.bp-tv-link-input:focus {
    border-color: var(--bp-tv-accent);
}

.bp-tv-ticket-summary {
    margin-bottom: 0.75rem;
}

.bp-tv-ticket-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bp-tv-gray-light);
    font-size: 0.85rem;
}

.bp-tv-ticket-summary-item:last-child {
    border-bottom: none;
}

.bp-tv-ticket-summary-event {
    font-weight: 600;
}

.bp-tv-ticket-summary-qty {
    color: var(--bp-tv-accent);
    font-weight: 700;
}

.bp-tv-expiry-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* ------------------------------------------------------------------
 * Result Page – Badge
 * ----------------------------------------------------------------*/
.bp-tv-badge {
    text-align: center;
    margin-bottom: 1rem;
}

.bp-tv-badge-icon {
    display: inline-block;
}

.bp-tv-badge-valid .bp-tv-badge-icon {
    filter: drop-shadow(0 0 16px rgba(0, 255, 174, 0.45));
}

.bp-tv-badge-invalid .bp-tv-badge-icon {
    filter: drop-shadow(0 0 16px rgba(255, 71, 87, 0.4));
}

/* ------------------------------------------------------------------
 * Result Page – Valid Card Border Glow
 * ----------------------------------------------------------------*/
.bp-tv-result-valid {
    border-color: var(--bp-tv-accent);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 24px rgba(0, 255, 174, 0.08);
}

.bp-tv-result-invalid {
    border-color: var(--bp-tv-error);
}

/* ------------------------------------------------------------------
 * Result Page – Ticket List
 * ----------------------------------------------------------------*/
.bp-tv-ticket-list {
    margin-bottom: 1.5rem;
}

.bp-tv-ticket-item {
    padding: 1rem;
    background: var(--bp-tv-gray);
    border-radius: calc(var(--bp-tv-radius) * 0.65);
    border: 1px solid var(--bp-tv-gray-light);
    margin-bottom: 0.65rem;
}

.bp-tv-ticket-item:last-child {
    margin-bottom: 0;
}

.bp-tv-ticket-event {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.bp-tv-ticket-icon {
    font-size: 1.15rem;
}

.bp-tv-ticket-event strong {
    font-size: 1rem;
    color: var(--bp-tv-text);
}

.bp-tv-ticket-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-left: 1.65rem;
}

.bp-tv-ticket-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.bp-tv-ticket-qty {
    font-size: 0.85rem;
    color: var(--bp-tv-accent);
    font-weight: 600;
}

/* ------------------------------------------------------------------
 * Result Page – Timestamps
 * ----------------------------------------------------------------*/
.bp-tv-timestamps {
    padding: 1rem;
    background: var(--bp-tv-gray);
    border-radius: calc(var(--bp-tv-radius) * 0.65);
    margin-bottom: 1.25rem;
}

.bp-tv-timestamp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

.bp-tv-ts-label {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}

.bp-tv-ts-value {
    color: var(--bp-tv-text);
    font-weight: 600;
}

/* ------------------------------------------------------------------
 * Result Page – Explanation & Disclaimer
 * ----------------------------------------------------------------*/
.bp-tv-explanation {
    font-size: 0.88rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.25rem;
}

.bp-tv-explanation p {
    margin: 0;
}

.bp-tv-disclaimer {
    padding: 1rem 1.25rem;
    background: rgba(255, 200, 0, 0.07);
    border: 1px solid rgba(255, 200, 0, 0.25);
    border-radius: calc(var(--bp-tv-radius) * 0.65);
    font-size: 0.85rem;
    line-height: 1.6;
    color: #ffd43b;
    margin-bottom: 1.25rem;
}

.bp-tv-system-note {
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
    border-top: 1px solid var(--bp-tv-gray-light);
    padding-top: 1rem;
}

.bp-tv-system-note p {
    margin: 0;
}

/* Invalid message */
.bp-tv-invalid-message {
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.bp-tv-invalid-message p {
    margin: 0;
}

/* Disabled state */
.bp-tv-disabled {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

/* ------------------------------------------------------------------
 * Responsive
 * ----------------------------------------------------------------*/
@media (max-width: 600px) {
    .bp-tv-wrapper {
        padding: 1rem 0.5rem;
    }

    .bp-tv-card {
        padding: 1.75rem 1.25rem;
    }

    .bp-tv-heading {
        font-size: 1.35rem;
    }

    .bp-tv-link-box {
        flex-direction: column;
    }

    .bp-tv-btn-copy {
        width: 100%;
    }

    .bp-tv-timestamp-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .bp-tv-code-input {
        font-size: 1.5rem;
        letter-spacing: 0.35em;
    }

    .bp-tv-code-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .bp-tv-code-separator {
        display: none;
    }
}
