/**
 * Event Entries Ticker Styles
 * Scrolling ticker for Form 36 event entries
 */

/* Base Container */
.scyc-event-entries-ticker {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1f35 0%, #2d3a5a 100%);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin: 1.5rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Header */
.scyc-ticker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scyc-ticker-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.scyc-ticker-icon {
    font-size: 20px;
    color: #4a9eff;
}

.scyc-ticker-count {
    font-size: 13px;
    color: #8fa4c4;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Ticker Wrapper */
.scyc-ticker-wrapper {
    position: relative;
    padding: 16px 0;
    overflow: hidden;
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 5%,
        black 95%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 5%,
        black 95%,
        transparent 100%
    );
}

/* Ticker Track - Animation */
.scyc-ticker-track {
    display: flex;
    gap: 0;
    width: max-content;
    animation: ticker-scroll linear infinite;
    will-change: transform;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Pause on hover */
.scyc-ticker-wrapper:hover .scyc-ticker-track,
.scyc-ticker-track.paused {
    animation-play-state: paused;
}

/* Ticker Item */
.scyc-ticker-item {
    flex-shrink: 0;
    padding: 0 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.scyc-ticker-item:last-child {
    border-right: none;
}

/* Entry Content */
.scyc-ticker-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
}

.scyc-entry-helm {
    font-weight: 600;
    color: #4a9eff;
}

.scyc-entry-boat {
    color: #e0e6f0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scyc-entry-sail {
    color: #ffd700;
    font-weight: 500;
}

.scyc-entry-country {
    color: #8fa4c4;
    font-size: 13px;
}

.scyc-entry-club {
    color: #a8c7ff;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scyc-entry-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

/* Footer */
.scyc-ticker-footer {
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: right;
}

.scyc-ticker-hint {
    font-size: 11px;
    color: #6b7c99;
    font-style: italic;
}

/* Empty State */
.scyc-ticker-empty .scyc-ticker-wrapper--empty {
    padding: 40px 20px;
    mask-image: none;
    -webkit-mask-image: none;
}

.scyc-ticker-empty-message {
    text-align: center;
    color: #8fa4c4;
}

.scyc-ticker-empty-message p {
    margin: 0 0 8px 0;
    font-size: 15px;
}

.scyc-ticker-empty-sub {
    font-size: 13px !important;
    color: #6b7c99 !important;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .scyc-ticker-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 15px;
    }

    .scyc-ticker-title {
        font-size: 14px;
    }

    .scyc-ticker-count {
        font-size: 12px;
        padding: 3px 10px;
    }

    .scyc-ticker-entry {
        font-size: 13px;
        gap: 8px;
    }

    .scyc-ticker-item {
        padding: 0 16px;
    }

    .scyc-entry-boat {
        max-width: 100px;
    }

    .scyc-entry-club {
        max-width: 80px;
    }

    /* Hide some elements on mobile to reduce clutter */
    .scyc-entry-country {
        display: none;
    }

    .scyc-ticker-footer {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .scyc-event-entries-ticker {
        border-radius: 0;
        margin: 1rem calc(-50vw + 50%);
        width: 100vw;
        max-width: 100vw;
    }

    .scyc-ticker-entry {
        font-size: 12px;
        gap: 6px;
    }

    .scyc-entry-boat,
    .scyc-entry-club {
        max-width: 70px;
    }

    /* Hide club on very small screens */
    .scyc-entry-club {
        display: none;
    }

    .scyc-entry-separator {
        margin: 0 2px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .scyc-event-entries-ticker {
        background: #000000;
        border: 2px solid #ffffff;
    }

    .scyc-ticker-entry {
        color: #ffffff;
    }

    .scyc-entry-helm {
        color: #00ff00;
    }

    .scyc-entry-sail {
        color: #ffff00;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .scyc-ticker-track {
        animation: none;
        flex-wrap: wrap;
        width: 100%;
    }

    .scyc-ticker-item {
        flex-shrink: 1;
        padding: 8px 24px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .scyc-ticker-wrapper {
        mask-image: none;
        -webkit-mask-image: none;
        overflow-y: auto;
        max-height: 300px;
    }
}

/* Dark/Light theme considerations */
/* If the site uses a light theme, these adjustments can be made */
.scyc-event-entries-ticker.scyc-ticker-light-theme {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.scyc-ticker-light-theme .scyc-ticker-header {
    background: rgba(0, 0, 0, 0.05);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.scyc-ticker-light-theme .scyc-ticker-title {
    color: #1a1f35;
}

.scyc-ticker-light-theme .scyc-ticker-count {
    color: #495057;
    background: rgba(0, 0, 0, 0.08);
}

.scyc-ticker-light-theme .scyc-ticker-entry {
    color: #212529;
}

.scyc-ticker-light-theme .scyc-entry-helm {
    color: #0066cc;
}

.scyc-ticker-light-theme .scyc-entry-boat {
    color: #495057;
}

.scyc-ticker-light-theme .scyc-entry-sail {
    color: #b8860b;
}

.scyc-ticker-light-theme .scyc-entry-country {
    color: #6c757d;
}

.scyc-ticker-light-theme .scyc-entry-club {
    color: #0066cc;
}

.scyc-ticker-light-theme .scyc-entry-separator {
    color: rgba(0, 0, 0, 0.2);
}

.scyc-ticker-light-theme .scyc-ticker-item {
    border-right-color: rgba(0, 0, 0, 0.1);
}

.scyc-ticker-light-theme .scyc-ticker-footer {
    background: rgba(0, 0, 0, 0.03);
    border-top-color: rgba(0, 0, 0, 0.05);
}

.scyc-ticker-light-theme .scyc-ticker-hint {
    color: #6c757d;
}

/* Loading state */
.scyc-ticker-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.scyc-ticker-loading::after {
    content: "";
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #4a9eff;
    border-radius: 50%;
    animation: ticker-spin 0.8s linear infinite;
}

@keyframes ticker-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .scyc-ticker-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    }

    .scyc-ticker-track {
        animation: none;
    }

    .scyc-ticker-wrapper:hover .scyc-ticker-track {
        animation-play-state: running;
    }

    .scyc-ticker-hint {
        display: none;
    }
}

/* ============================================
   RESPONSIVE TABLE STYLES
   ============================================ */

/* Table Container */
.scyc-entries-table-container {
    overflow: visible;
}

.scyc-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 400px;
    -webkit-overflow-scrolling: touch;
    padding: 0 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 158, 255, 0.4) rgba(255, 255, 255, 0.1);
}

.scyc-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scyc-table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.scyc-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(74, 158, 255, 0.4);
    border-radius: 4px;
}

.scyc-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 158, 255, 0.6);
}

/* Table Base Styles */
.scyc-entries-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 15px;
    line-height: 1.7;
}

.scyc-entries-table thead {
    background: rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1;
}

.scyc-entries-table th {
    padding: 18px 24px;
    text-align: center;
    font-weight: 600;
    color: #8fa4c4;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.scyc-entries-table td {
    padding: 20px 24px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.scyc-entries-table tbody tr:hover {
    background: rgba(74, 158, 255, 0.06);
}

.scyc-entries-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column-specific styles */
.scyc-entries-table .scyc-table-helm {
    font-weight: 600;
    color: #4a9eff;
    font-size: 16px;
}

.scyc-entries-table .scyc-table-boat {
    color: #e0e6f0;
    font-size: 15px;
}

.scyc-entries-table .scyc-table-sail {
    color: #ffd700;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.scyc-entries-table .scyc-table-class {
    color: #b8d4ff;
    font-size: 14px;
    font-style: italic;
}

.scyc-entries-table .scyc-table-club {
    color: #a8c7ff;
    font-size: 14px;
}

.scyc-entries-table .scyc-table-country {
    color: #8fa4c4;
    font-size: 14px;
}

/* Responsive Table - Tablet */
@media screen and (max-width: 768px) {
    .scyc-entries-table th {
        padding: 14px 18px;
        font-size: 12px;
    }

    .scyc-entries-table td {
        padding: 16px 18px;
    }

    .scyc-entries-table {
        font-size: 14px;
    }

    .scyc-entries-table .scyc-table-helm {
        font-size: 15px;
    }
}

/* Responsive Table - Mobile (Card Layout) */
@media screen and (max-width: 600px) {
    .scyc-entries-table thead {
        display: none;
    }

    .scyc-entries-table,
    .scyc-entries-table tbody,
    .scyc-entries-table tr,
    .scyc-entries-table td {
        display: block;
        width: 100%;
    }

    .scyc-entries-table tr {
        margin-bottom: 12px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 6px;
        padding: 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .scyc-entries-table tr:hover {
        background: rgba(74, 158, 255, 0.15);
    }

    .scyc-entries-table td {
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .scyc-entries-table td:last-child {
        border-bottom: none;
    }

    .scyc-entries-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #8fa4c4;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-right: 12px;
    }

    .scyc-entries-table .scyc-table-helm {
        font-size: 16px;
        color: #4a9eff;
    }

    .scyc-entries-table .scyc-table-sail {
        color: #ffd700;
    }
}

/* Light Theme Table */
.scyc-ticker-light-theme .scyc-entries-table th {
    color: #6c757d;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.scyc-ticker-light-theme .scyc-entries-table td {
    color: #212529;
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.scyc-ticker-light-theme .scyc-entries-table tbody tr:hover {
    background: rgba(0, 102, 204, 0.08);
}

.scyc-ticker-light-theme .scyc-entries-table .scyc-table-helm {
    color: #0066cc;
}

.scyc-ticker-light-theme .scyc-entries-table .scyc-table-boat {
    color: #495057;
}

.scyc-ticker-light-theme .scyc-entries-table .scyc-table-sail {
    color: #b8860b;
}

.scyc-ticker-light-theme .scyc-entries-table .scyc-table-class {
    color: #6c757d;
    font-style: italic;
}

.scyc-ticker-light-theme .scyc-entries-table .scyc-table-club {
    color: #0066cc;
}

.scyc-ticker-light-theme .scyc-entries-table .scyc-table-country {
    color: #6c757d;
}

@media screen and (max-width: 600px) {
    .scyc-ticker-light-theme .scyc-entries-table tr {
        background: rgba(0, 0, 0, 0.03);
        border-color: rgba(0, 0, 0, 0.08);
    }

    .scyc-ticker-light-theme .scyc-entries-table td {
        border-bottom-color: rgba(0, 0, 0, 0.04);
    }

    .scyc-ticker-light-theme .scyc-entries-table td::before {
        color: #6c757d;
    }
}
