/**
 * Estilos Base Frontend de LoteriaRD
 * Powered by Hostuis Group LLC
 */

:root {
    --lrd-pub-primary: #1e3a8a;
    --lrd-pub-accent: #f59e0b;
    --lrd-pub-ball-bg: #2563eb;
    --lrd-pub-ball-text: #ffffff;
    --lrd-pub-radius: 12px;
    --lrd-pub-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --lrd-pub-card-bg: #ffffff;
    --lrd-pub-text: #1e293b;
    --lrd-pub-border: #e2e8f0;
    --lrd-pub-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}

.loteriard-container {
    font-family: var(--lrd-pub-font);
    color: var(--lrd-pub-text);
    width: 100%;
    margin: 20px 0;
    box-sizing: border-box;
}

.loteriard-container * {
    box-sizing: border-box;
}

/* Filter Bar */
.loteriard-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
}

.lrd-pill {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.lrd-pill:hover,
.lrd-pill.active {
    background: var(--lrd-pub-primary);
    color: #ffffff;
    border-color: var(--lrd-pub-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Grid Layout */
.loteriard-grid {
    display: grid;
    gap: 24px;
}

.loteriard-cols-1 { grid-template-columns: 1fr; }
.loteriard-cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.loteriard-cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.loteriard-cols-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.loteriard-cols-5 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.loteriard-cols-6 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

@media (max-width: 768px) {
    .loteriard-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Card Item */
.loteriard-card-item {
    background: var(--lrd-pub-card-bg);
    border: 1px solid var(--lrd-pub-border);
    border-radius: var(--lrd-pub-radius);
    padding: 20px;
    box-shadow: var(--lrd-pub-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.loteriard-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.12);
}

.lrd-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--lrd-pub-border);
}

.lrd-card-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lrd-logo-wrap {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lrd-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lrd-lottery-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--lrd-pub-text);
}

.lrd-schedule {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.lrd-cat-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.lrd-cat-dominicana { background: #dbeafe; color: #1e40af; }
.lrd-cat-americana   { background: #fef3c7; color: #92400e; }
.lrd-cat-otra        { background: #ede9fe; color: #5b21b6; }

/* Games and Balls */
.lrd-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lrd-game-row {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 10px 12px;
}

.lrd-game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.lrd-game-name {
    font-weight: 700;
    color: var(--lrd-pub-text);
}

.lrd-game-date {
    color: #64748b;
    font-size: 11px;
}

.lrd-balls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.lrd-ball {
    width: 38px;
    height: 38px;
    background: radial-gradient(circle at 35% 35%, #60a5fa, var(--lrd-pub-ball-bg) 70%, #1e3a8a);
    color: var(--lrd-pub-ball-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset -2px -2px 4px rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.lrd-ball:hover {
    transform: scale(1.1);
}

.lrd-ball-pos-1 {
    background: radial-gradient(circle at 35% 35%, #fbbf24, #d97706 70%, #92400e);
}

.lrd-ball-special {
    background: radial-gradient(circle at 35% 35%, #f87171, #dc2626 70%, #991b1b);
}

.lrd-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--lrd-pub-border);
    font-size: 11px;
}

.lrd-live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
    font-weight: 600;
}

.lrd-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.loteriard-btn,
.loteriard-card__btn,
.loteriard-btn-custom,
.lrd-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    background: linear-gradient(135deg, var(--lrd-pub-primary, #1e3a8a) 0%, #2563eb 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    outline: none;
    user-select: none;
}

.loteriard-btn:hover,
.loteriard-card__btn:hover,
.loteriard-btn-custom:hover,
.lrd-share-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

.loteriard-btn:active,
.loteriard-card__btn:active,
.loteriard-btn-custom:active,
.lrd-share-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.2);
}

/* List Layout */
.loteriard-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loteriard-list-item {
    background: #ffffff;
    border: 1px solid var(--lrd-pub-border);
    border-radius: var(--lrd-pub-radius);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: var(--lrd-pub-shadow);
}

.lrd-list-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lrd-logo-wrap-sm {
    width: 36px;
    height: 36px;
}

.lrd-list-titles h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.lrd-list-titles small {
    color: #64748b;
    font-size: 11px;
}

.lrd-list-games-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.lrd-list-single-game {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lrd-game-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.lrd-balls-container-sm {
    display: flex;
    gap: 6px;
}

.lrd-ball-sm {
    width: 30px;
    height: 30px;
    font-size: 13px;
}

/* Top Header Bar Ticker with Fade */
.loteriard-top-header-bar {
    background: linear-gradient(90deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    padding: 8px 16px;
    font-size: 13px;
    overflow: hidden;
    position: relative;
}

.lrd-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    min-height: 32px;
}

.lrd-header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.lrd-pulse-dot {
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    animation: lrd-pulse 1.5s infinite;
}

.lrd-header-fade-slider {
    flex-grow: 1;
    position: relative;
    height: 32px;
    margin: 0 16px;
    overflow: hidden;
}

.lrd-fade-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, transform 0.6s ease;
    transform: translateY(8px);
}

.lrd-fade-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lrd-slide-content {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.lrd-slide-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.lrd-slide-name {
    font-weight: 700;
    color: #ffffff;
}

.lrd-slide-gamename {
    color: #94a3b8;
    font-size: 12px;
}

.lrd-slide-balls {
    display: flex;
    gap: 4px;
}

.lrd-header-ball {
    width: 24px;
    height: 24px;
    background: #f59e0b;
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

.lrd-header-ball-special {
    background: #ef4444;
    color: #ffffff;
}

.lrd-header-nav-arrows {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lrd-nav-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    user-select: none;
}

.lrd-nav-btn:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.lrd-nav-btn:active {
    transform: scale(0.95);
}

/* Live Results Widget */
.loteriard-live-widget {
    background: #0f172a;
    color: #ffffff;
    border-radius: var(--lrd-pub-radius);
    padding: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.lrd-live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lrd-live-tag {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lrd-pulsing-badge {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 10px #ef4444;
    animation: lrd-pulse 1.2s infinite;
}

.lrd-live-label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ef4444;
}

.lrd-countdown-timer {
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    color: #f59e0b;
}

.lrd-live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.lrd-live-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 16px;
    transition: transform 0.2s, background 0.2s;
}

.lrd-live-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.lrd-live-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.lrd-live-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.lrd-live-title-box strong {
    display: block;
    font-size: 14px;
}

.lrd-live-title-box small {
    color: #94a3b8;
    font-size: 11px;
}

.lrd-live-balls-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.lrd-live-ball {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at 35% 35%, #3b82f6, #1d4ed8);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.lrd-live-ball-special {
    background: radial-gradient(circle at 35% 35%, #ef4444, #b91c1c);
}

.lrd-live-card-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
}

.lrd-status-pill {
    color: #10b981;
    font-weight: 600;
}

/* Custom Buttons & Effects */
.loteriard-btn-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    background: linear-gradient(135deg, var(--lrd-pub-primary, #1e3a8a) 0%, #2563eb 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    outline: none;
}

.loteriard-btn-glow:hover {
    box-shadow: 0 0 24px rgba(37, 99, 235, 0.75), 0 4px 14px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    color: #ffffff;
}

.loteriard-btn-scale:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
    color: #ffffff;
}

/* Single Lottery View */
.loteriard-single-lottery-card {
    background: #ffffff;
    border: 1px solid var(--lrd-pub-border);
    border-radius: var(--lrd-pub-radius);
    padding: 30px;
    box-shadow: var(--lrd-pub-shadow);
}

.lrd-single-brand {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--lrd-pub-border);
}

.lrd-single-logo-box {
    width: 80px;
    height: 80px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.lrd-single-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lrd-single-info h2 {
    margin: 0 0 6px 0;
    font-size: 24px;
}

.lrd-single-desc {
    color: #64748b;
    margin: 0 0 10px 0;
    font-size: 13px;
}

.lrd-single-meta {
    display: flex;
    gap: 12px;
}

.lrd-meta-pill {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.lrd-single-games-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.lrd-single-game-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.game-balls-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.lrd-ball-lg {
    width: 46px;
    height: 46px;
    font-size: 18px;
}

.ball-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ball-label {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
}

/* Modal Popup */
.loteriard-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.loteriard-modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: lrd-modal-zoom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.loteriard-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title-group h3 {
    margin: 0;
    font-size: 18px;
}

.loteriard-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.loteriard-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.loteriard-modal-lotteries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.modal-lottery-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.modal-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.modal-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.modal-balls-wrap {
    display: flex;
    gap: 6px;
}

.loteriard-modal-footer {
    padding: 12px 24px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #64748b;
    font-size: 11px;
}

@keyframes lrd-modal-zoom {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
