/**
 * Single Event Template Styles
 * Based on Vietnam International Marathon 2025 design
 * 
 * @package Best_Marathon_Registration
 * @version 1.0.0
 */

/* CSS Variables */
:root {
    --gold: #FFB800;
    --gold-light: #FFF3E0;
    --gold-dark: #F57C00;
    --gray-900: #212121;
    --gray-700: #616161;
    --gray-600: #757575;
    --gray-500: #9E9E9E;
    --gray-300: #E0E0E0;
    --gray-200: #EEEEEE;
    --gray-100: #F5F5F5;
    --white: #FFFFFF;
    --success: #4CAF50;
    --danger: #F44336;
    --warning: #FF9800;
    --info: #2196F3;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
.bmr-single-event-container {
    font-family: 'Be Vietnam Pro', sans-serif !important;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Performance optimizations */
.bmr-single-event-container img {
    loading: lazy;
    decoding: async;
}

/* Container */
.bmr-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.75rem;
}

/* Breadcrumb */
.bmr-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.bmr-breadcrumb a {
    color: var(--gray-700);
    text-decoration: none;
    transition: color 0.3s;
}

.bmr-breadcrumb a:hover {
    color: var(--gold);
}

/* Event Hero */
.bmr-event-hero {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.bmr-hero-container {
    position: relative;
}

.bmr-hero-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bmr-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.85);
}

.bmr-hero-content {
    padding: 1.25rem 1rem;
    background: var(--white);
}

.bmr-event-badges {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.bmr-badge {
    padding: 0.25rem 0.625rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--gray-700);
}

.bmr-badge.hot {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.bmr-badge.certified {
    background: var(--gold-light);
    color: var(--gold-dark);
    border-color: var(--gold);
}

.bmr-hero-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: var(--gray-900);
}

.bmr-hero-subtitle {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.4;
}

.bmr-hero-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.bmr-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--gray-700);
}

.bmr-hero-meta-icon {
    color: var(--gold);
}

.bmr-status-active {
    color: var(--success) !important;
}

.bmr-status-upcoming {
    color: var(--warning) !important;
}

.bmr-status-closed {
    color: var(--gray-500) !important;
}

/* Sticky Navigation */
.bmr-sticky-nav-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.bmr-sticky-nav-container.scrolled {
    box-shadow: var(--shadow-md);
}

.bmr-nav-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.bmr-nav-wrapper::-webkit-scrollbar {
    display: none;
}

.bmr-nav-tabs {
    display: flex;
    min-width: max-content;
    background: var(--white);
}

.bmr-nav-tab {
    flex: 0 0 auto;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    display: block;
    position: relative;
}

.bmr-nav-tab:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.bmr-nav-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: linear-gradient(to bottom, transparent, rgba(255, 184, 0, 0.05));
}

/* Nav indicator for mobile */
@media (max-width: 768px) {
    .bmr-nav-wrapper::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to right, transparent, var(--white));
        pointer-events: none;
    }
}

/* Main Layout */
.bmr-main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 60px;
}

/* Main Content */
.bmr-main-content {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

/* Sidebar */
.bmr-sidebar {
    display: none;
}

.bmr-widget-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.bmr-widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

/* Content Sections */
.bmr-content-section {
    padding: 2rem 0;
    border-bottom: 1px solid var(--gray-200);
    scroll-margin-top: 80px;
}

.bmr-content-section:first-child {
    padding-top: 1rem;
}

.bmr-content-section:last-child {
    border-bottom: none;
    padding-bottom: 1rem;
}

.bmr-collapsible-section {
    display: none;
}

.bmr-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.bmr-content-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bmr-content-title::before {
    content: '';
    width: 3px;
    height: 20px;
    background: var(--gold);
    border-radius: 2px;
}

/* Expandable Content */
.bmr-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--gold-light), rgba(255, 184, 0, 0.1));
    color: var(--gold-dark);
    border: 1px solid var(--gold);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.bmr-expand-btn:hover {
    background: var(--gold);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.3);
}

.bmr-content-text {
    color: var(--gray-700);
    line-height: 1.7;
    font-size: 0.875rem;
}

.bmr-content-text p {
    margin-bottom: 0.875rem;
}

.bmr-content-text ul {
    margin: 0.875rem 0;
    padding-left: 1.25rem;
}

.bmr-content-text li {
    margin-bottom: 0.375rem;
    position: relative;
}

.bmr-content-text li::marker {
    color: var(--gold);
}

/* Distance Cards */
.bmr-distance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.bmr-distance-card {
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.bmr-distance-card:active {
    transform: scale(0.98);
}

.bmr-distance-card.selected {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
}

.bmr-distance-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.125rem;
}

.bmr-distance-desc {
    font-size: 0.75rem;
    opacity: 0.9;
}

.bmr-distance-price {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.375rem;
}

/* Schedule Timeline */
.bmr-timeline-day {
    margin-bottom: 1.5rem;
}

.bmr-timeline-date {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--gold-light);
}

.bmr-timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-left: 2px solid var(--gray-300);
    margin-left: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
}

.bmr-timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0.875rem;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.bmr-timeline-time {
    min-width: 50px;
    font-weight: 700;
    color: var(--gray-700);
    font-size: 0.8125rem;
}

.bmr-timeline-content {
    flex: 1;
}

.bmr-timeline-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
    font-size: 0.875rem;
}

.bmr-timeline-desc {
    font-size: 0.75rem;
    color: var(--gray-600);
    line-height: 1.4;
}

/* Awards Table */
.bmr-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.bmr-awards-table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
}

.bmr-awards-table th {
    background: var(--gold-light);
    color: var(--gray-900);
    font-weight: 600;
    padding: 0.625rem 0.5rem;
    text-align: left;
    font-size: 0.75rem;
    white-space: nowrap;
}

.bmr-awards-table td {
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid var(--gray-300);
    font-size: 0.75rem;
}

/* Map Container */
.bmr-map-container {
    width: 100%;
    height: 200px;
    background: var(--gray-100);
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    border: 2px dashed var(--gray-300);
    font-size: 0.875rem;
}

/* Gallery Grid */
.bmr-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.bmr-gallery-item {
    position: relative;
    padding-bottom: 100%;
    background: var(--gray-100);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

.bmr-gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bmr-gallery-item:hover img {
    transform: scale(1.05);
}

/* Countdown Widget */
.bmr-countdown-widget {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    text-align: center;
}

.bmr-countdown-label {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.bmr-countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.bmr-countdown-item {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 0.5rem;
}

.bmr-countdown-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.bmr-countdown-unit {
    font-size: 0.625rem;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Registration Widget */
.bmr-registration-widget {
    background: linear-gradient(135deg, var(--white) 0%, #FAFAFA 100%);
    border: 2px solid var(--gold-light);
}

.bmr-widget-price-display {
    text-align: center;
    padding: 1rem;
    background: var(--gold-light);
    margin: -1.25rem -1.25rem 1rem;
    border-radius: 10px 10px 0 0;
}

.bmr-widget-price-label {
    font-size: 0.75rem;
    color: var(--gray-700);
    margin-bottom: 0.125rem;
}

.bmr-widget-price-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--gold-dark);
    line-height: 1;
}

.bmr-price-note {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Related Events Widget */
.bmr-related-events {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bmr-event-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.bmr-event-card:hover {
    background: var(--gold-light);
    transform: translateX(4px);
}

.bmr-event-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: cover;
}

.bmr-event-info {
    flex: 1;
    min-width: 0;
}

.bmr-event-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.8125rem;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bmr-event-date {
    font-size: 0.6875rem;
    color: var(--gray-600);
}

/* Share Buttons Widget */
.bmr-share-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.bmr-share-btn {
    padding: 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    font-size: 1.125rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bmr-share-btn:hover {
    background: var(--gold-light);
    border-color: var(--gold);
}

/* Bottom Actions */
.bmr-bottom-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-300);
    padding: 0.75rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    z-index: 90;
    margin: 0 -0.75rem;
}

.bmr-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.bmr-action-btn {
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.bmr-register-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
}

.bmr-register-btn:active {
    transform: scale(0.98);
}

.bmr-save-btn {
    background: var(--white);
    color: var(--gold);
    border: 2px solid var(--gold);
}

.bmr-save-btn:active {
    background: var(--gold-light);
}

.bmr-disabled-btn {
    background: var(--gray-300);
    color: var(--gray-600);
    cursor: not-allowed;
}

/* Floating Widget */
.bmr-floating-widget {
    position: fixed;
    bottom: 80px;
    right: 1rem;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.bmr-countdown-bubble {
    background: var(--gold);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.bmr-share-fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.bmr-share-fab:active {
    transform: scale(0.95);
}

/* Modal */
.bmr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 1rem;
    align-items: center;
    justify-content: center;
}

.bmr-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.bmr-modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.bmr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.bmr-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.bmr-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form Elements */
.bmr-form-group {
    margin-bottom: 1rem;
}

.bmr-form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
    display: block;
}

/* Select styling removed - using theme defaults */

.bmr-quantity-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    background: var(--white);
}

.bmr-qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.bmr-qty-btn:hover {
    background: var(--gold-light);
}

.bmr-qty-input {
    flex: 1;
    text-align: center;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.bmr-price-display {
    text-align: center;
    padding: 1rem;
    background: var(--gold-light);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.bmr-price-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--gold-dark);
}

/* Share Options */
.bmr-share-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.bmr-share-option {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bmr-share-option:active {
    transform: scale(0.95);
}

.bmr-share-option:hover {
    background: var(--gold-light);
    border-color: var(--gold);
}

.bmr-registration-closed {
    text-align: center;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 8px;
    color: var(--gray-600);
}

/* Responsive Design */
@media (min-width: 640px) {
    .bmr-container {
        padding: 0 1rem;
    }

    .bmr-hero-image {
        height: 300px;
    }

    .bmr-hero-title {
        font-size: 1.625rem;
    }

    .bmr-hero-content {
        padding: 1.5rem;
    }

    .bmr-distance-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .bmr-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .bmr-content-title {
        font-size: 1.25rem;
    }

    .bmr-content-text {
        font-size: 0.9375rem;
    }
}

@media (min-width: 968px) {
    .bmr-container {
        padding: 0 1.5rem;
    }

    .bmr-main-layout {
        grid-template-columns: 1fr 360px;
    }

    .bmr-sidebar {
        display: block;
        position: sticky;
        top: 70px;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
    }

    .bmr-sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .bmr-sidebar::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 2px;
    }

    .bmr-hero-image {
        height: 400px;
    }

    .bmr-hero-content {
        padding: 2rem;
    }

    .bmr-hero-title {
        font-size: 2rem;
    }

    .bmr-hero-subtitle {
        font-size: 1rem;
    }

    .bmr-main-content {
        padding: 2rem;
    }

    .bmr-nav-tab {
        padding: 1.25rem 1.5rem;
        font-size: 0.95rem;
    }

    .bmr-bottom-actions {
        display: none;
    }

    .bmr-floating-widget {
        display: none;
    }
}

/* Touch optimizations */
@media (hover: none) {
    .bmr-nav-tab,
    .bmr-distance-card,
    .bmr-expand-btn,
    .bmr-action-btn {
        -webkit-tap-highlight-color: rgba(255, 184, 0, 0.1);
    }
}

/* Loading state */
.bmr-skeleton {
    animation: skeleton-loading 1s infinite alternate;
    background: linear-gradient(90deg, var(--gray-200) 0%, var(--gray-100) 50%, var(--gray-200) 100%);
}

@keyframes skeleton-loading {
    0% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Smooth scroll for iOS */
@supports (-webkit-touch-callout: none) {
    .bmr-nav-wrapper {
        -webkit-overflow-scrolling: touch;
    }
}


