/**
 * Sve ili Ništa — Plugin Styles v4.0
 * Tamni dizajn s narančastim kuglicama (prema korisničkom mockupu).
 * Mobile-first, responzivno.
 */

/* ============================================================
   Design Tokens
   ============================================================ */
.sin-widget {
    /* Pozadina i površine - tamna paleta */
    --sin-bg: #0f1828;
    --sin-surface: #111b2e;
    --sin-surface-hover: #152238;

    /* Tekst */
    --sin-text: #ffffff;
    --sin-text-muted: #6b7a90;
    --sin-text-subtle: #4a5568;

    /* Accent - narančasta */
    --sin-accent: #ff8c42;
    --sin-accent-bright: #ff9a52;
    --sin-accent-dark: #d66f2d;
    --sin-accent-soft: rgba(255, 140, 66, 0.12);

    /* Hot/Cold */
    --sin-hot: #ff8c42;
    --sin-cold: #4a9eff;

    /* Badge pozadine */
    --sin-badge-bg: #2a1810;
    --sin-badge-border: #3d2618;

    /* Tipografija */
    --sin-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* Zaobljenost */
    --sin-radius-sm: 6px;
    --sin-radius-md: 12px;
    --sin-radius-lg: 18px;
    --sin-radius-xl: 24px;

    /* Razmaci */
    --sin-space-xs: 6px;
    --sin-space-sm: 10px;
    --sin-space-md: 16px;
    --sin-space-lg: 24px;
    --sin-space-xl: 32px;

    /* Kuglice */
    --sin-ball-size: 36px;
    --sin-ball-font-size: 14px;
    --sin-ball-gap: 8px;

    font-family: var(--sin-font);
    color: var(--sin-text);
    line-height: 1.5;
    max-width: 100%;
    margin: var(--sin-space-lg) 0;
    box-sizing: border-box;
}

.sin-widget *,
.sin-widget *::before,
.sin-widget *::after {
    box-sizing: border-box;
}

/* ============================================================
   Widget Header
   ============================================================ */
.sin-widget__header {
    margin-bottom: var(--sin-space-lg);
    padding: 0 var(--sin-space-sm);
}

.sin-widget__title {
    margin: 0 0 var(--sin-space-xs) 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sin-text);
    line-height: 1.2;
}

.sin-widget__subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--sin-text-muted);
}

.sin-widget__subtitle strong {
    color: var(--sin-text);
    font-weight: 600;
}

/* ============================================================
   Draw Cards - glavni element
   ============================================================ */
.sin-draws {
    display: flex;
    flex-direction: column;
    gap: var(--sin-space-md);
}

.sin-draw {
    background: var(--sin-surface);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--sin-radius-lg);
    padding: var(--sin-space-lg) var(--sin-space-xl);
    transition: background 0.2s ease, transform 0.2s ease;
    animation: sin-fade-in 0.4s ease both;
    animation-delay: var(--sin-delay, 0s);

    /* Horizontalni layout */
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.2fr) auto;
    gap: var(--sin-space-lg);
    align-items: center;
}

.sin-draw:hover {
    background: var(--sin-surface-hover);
}

/* Lijeva kolona - naziv igre + kolo badge */
.sin-draw__title-col {
    display: flex;
    flex-direction: column;
    gap: var(--sin-space-sm);
}

.sin-draw__game-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sin-text);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sin-draw__kolo-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 4px 14px;
    background: var(--sin-badge-bg);
    border: 1px solid var(--sin-badge-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sin-accent-bright);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

/* Srednja kolona - datum */
.sin-draw__date-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sin-draw__date-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sin-text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sin-draw__date {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sin-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* Desna kolona - kuglice */
.sin-draw__balls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sin-ball-gap);
    align-items: center;
    justify-content: flex-end;
}

/* ============================================================
   Lottery Balls — narančasti prsten stil
   ============================================================ */
.sin-ball {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--sin-ball-size);
    height: var(--sin-ball-size);
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--sin-accent);
    color: var(--sin-accent-bright);
    font-family: var(--sin-font);
    font-size: var(--sin-ball-font-size);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s ease,
                color 0.2s ease,
                box-shadow 0.2s ease;
}

.sin-ball:hover {
    transform: translateY(-2px) scale(1.08);
    background: var(--sin-accent);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4);
}

.sin-ball__shine {
    /* Skrivena za ovaj dizajn, zadržana za kompatibilnost */
    display: none;
}

.sin-ball__num {
    position: relative;
    z-index: 1;
}

/* Highlight kuglica kod filtera */
.sin-ball--highlight {
    background: var(--sin-accent);
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.3);
    animation: sin-pulse 1.8s ease-in-out infinite;
}

/* ============================================================
   Compact variant — za sidebar
   ============================================================ */
.sin-latest--compact {
    --sin-ball-size: 30px;
    --sin-ball-font-size: 12px;
}

.sin-latest--compact .sin-draw {
    padding: var(--sin-space-md) var(--sin-space-lg);
    grid-template-columns: 1fr;
    gap: var(--sin-space-sm);
}

.sin-latest--compact .sin-draw__balls {
    justify-content: flex-start;
}

.sin-latest--compact .sin-widget__title {
    font-size: 1.25rem;
}

/* ============================================================
   Statistics Block — светъл контейнер с тематични цветове
   ============================================================ */
.sin-stats {
    background: #ffffff;
    border: 1px solid #e8e8ea;
    border-radius: var(--sin-radius-lg);
    padding: 0;
    margin-bottom: var(--sin-space-xl);
    overflow: hidden;
}

.sin-stats__title {
    margin: 0;
    padding: var(--sin-space-md) var(--sin-space-lg);
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1f;
    background: #fafafa;
    border-bottom: 1px solid #e8e8ea;
    letter-spacing: -0.01em;
}

.sin-stats__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 640px) {
    .sin-stats__grid {
        grid-template-columns: 1fr 1fr;
    }
}

.sin-stats__block {
    display: flex;
    flex-direction: column;
    gap: var(--sin-space-md);
    padding: var(--sin-space-lg);
    position: relative;
}

/* HOT блок - топла тематика (кехлибарен/червен градиент) */
.sin-stats__block--hot {
    background: linear-gradient(135deg, #fff5eb 0%, #ffede0 50%, #ffe0cc 100%);
}

.sin-stats__block--hot::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #ff6b35 0%, #e8392c 100%);
}

/* COLD блок - студена тематика (ледено синьо) */
.sin-stats__block--cold {
    background: linear-gradient(135deg, #eef6ff 0%, #e0efff 50%, #d0e5ff 100%);
}

.sin-stats__block--cold::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #60a5fa 0%, #2c7ae8 100%);
}

/* На мобилен - разделителната линия е долу, не отляво */
@media (max-width: 639px) {
    .sin-stats__block--hot {
        border-bottom: 1px solid #ffd4b3;
    }
    .sin-stats__block--hot::before,
    .sin-stats__block--cold::before {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: linear-gradient(90deg, #ff6b35 0%, #e8392c 100%);
    }
    .sin-stats__block--cold::before {
        background: linear-gradient(90deg, #60a5fa 0%, #2c7ae8 100%);
    }
}

/* На desktop - вертикален divider между двата блока */
@media (min-width: 640px) {
    .sin-stats__block--hot {
        border-right: 1px solid #ffd4b3;
    }
}

.sin-stats__label {
    display: flex;
    align-items: center;
    gap: var(--sin-space-xs);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sin-stats__block--hot .sin-stats__label {
    color: #c2410c;
}

.sin-stats__block--cold .sin-stats__label {
    color: #1d4ed8;
}

.sin-stats__icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sin-stats__icon--hot {
    background: radial-gradient(circle at 30% 30%, #ff8c42, #e8392c);
}
.sin-stats__icon--cold {
    background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb);
}

.sin-stats__balls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* Statistika - kuglice s brojem pojavljivanja */
.sin-stat-ball {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 64px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.sin-stat-ball,
.sin-stat-ball:hover,
.sin-stat-ball:focus,
.sin-stat-ball:active,
.sin-stat-ball:visited {
    text-decoration: none !important;
}

.sin-stat-ball:hover {
    transform: translateY(-3px);
}

.sin-stat-ball__num {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    transition: all 0.2s ease;
    text-decoration: none;
}

/* HOT топчета - топла паста (червено-оранжево) */
.sin-stat-ball--hot .sin-stat-ball__num {
    background: linear-gradient(135deg, #fff5eb 0%, #ffebd6 100%);
    border: 2px solid #ff6b35;
    color: #c2410c;
    box-shadow:
        inset 1px 1px 2px rgba(255, 255, 255, 0.8),
        0 2px 6px rgba(255, 107, 53, 0.25);
}

.sin-stat-ball--hot:hover .sin-stat-ball__num {
    background: linear-gradient(135deg, #ff8c42 0%, #e8392c 100%);
    color: #ffffff;
    border-color: #c2410c;
    box-shadow:
        0 4px 12px rgba(232, 57, 44, 0.4),
        0 8px 20px rgba(255, 107, 53, 0.2);
    transform: scale(1.05);
}

/* COLD топчета - студена паста (ледено синьо) */
.sin-stat-ball--cold .sin-stat-ball__num {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #60a5fa;
    color: #1d4ed8;
    box-shadow:
        inset 1px 1px 2px rgba(255, 255, 255, 0.8),
        0 2px 6px rgba(96, 165, 250, 0.25);
}

.sin-stat-ball--cold:hover .sin-stat-ball__num {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    color: #ffffff;
    border-color: #1e3a8a;
    box-shadow:
        0 4px 12px rgba(37, 99, 235, 0.4),
        0 8px 20px rgba(96, 165, 250, 0.2);
    transform: scale(1.05);
}

.sin-stat-ball__count {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.sin-stat-ball--hot .sin-stat-ball__count {
    color: #c2410c;
}

.sin-stat-ball--cold .sin-stat-ball__count {
    color: #1d4ed8;
}

/* ============================================================
   Filter Form
   ============================================================ */
.sin-filter {
    background: var(--sin-surface);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--sin-radius-lg);
    padding: var(--sin-space-md);
    margin-bottom: var(--sin-space-lg);
}

.sin-filter__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sin-space-md);
    align-items: end;
}

@media (min-width: 640px) {
    .sin-filter__row {
        grid-template-columns: 1fr 1fr auto;
    }
}

.sin-filter__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sin-filter__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sin-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sin-filter__select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--sin-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--sin-radius-sm);
    padding: 10px 36px 10px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--sin-text);
    cursor: pointer;
    width: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7a90' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sin-filter__select:focus {
    outline: none;
    border-color: var(--sin-accent);
    box-shadow: 0 0 0 3px var(--sin-accent-soft);
}

.sin-filter__actions {
    display: flex;
    gap: var(--sin-space-sm);
    align-items: center;
}

/* ============================================================
   Buttons
   ============================================================ */
.sin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--sin-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.sin-button:active {
    transform: scale(0.98);
}

.sin-button--primary {
    background: var(--sin-accent);
    color: #ffffff;
    border-color: var(--sin-accent);
}

.sin-button--primary:hover {
    background: var(--sin-accent-bright);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

.sin-button--ghost {
    background: transparent;
    color: var(--sin-text-muted);
    border-color: rgba(255, 255, 255, 0.1);
}

.sin-button--ghost:hover {
    color: var(--sin-text);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   Empty state
   ============================================================ */
.sin-empty {
    padding: var(--sin-space-xl);
    text-align: center;
    color: var(--sin-text-muted);
    background: var(--sin-surface);
    border-radius: var(--sin-radius-md);
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

.sin-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes sin-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sin-pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 140, 66, 0.5);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sin-draw,
    .sin-ball,
    .sin-ball--highlight {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================================
   Responsive - Mobile
   ============================================================ */
@media (max-width: 900px) {
    .sin-draw {
        grid-template-columns: 1fr;
        gap: var(--sin-space-md);
        padding: var(--sin-space-md) var(--sin-space-lg);
    }

    .sin-draw__balls {
        justify-content: flex-start;
    }

    .sin-draw__date-col {
        flex-direction: row;
        align-items: baseline;
        gap: var(--sin-space-sm);
    }
}

@media (max-width: 480px) {
    .sin-widget {
        --sin-ball-size: 32px;
        --sin-ball-font-size: 12px;
        --sin-ball-gap: 6px;
    }

    .sin-widget__title { font-size: 1.4rem; }

    .sin-draw {
        padding: var(--sin-space-md);
        border-radius: var(--sin-radius-md);
    }

    .sin-draw__game-name {
        font-size: 1.05rem;
    }

    .sin-draw__date {
        font-size: 1rem;
    }

    /* Statistika - по-малки топчета за мобилно */
    .sin-stats__block { padding: var(--sin-space-md); }

    .sin-stats__balls { gap: 8px; }

    .sin-stat-ball {
        width: 40px;
        height: 56px;
    }

    .sin-stat-ball__num {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .sin-stat-ball__count {
        font-size: 10px;
        margin-top: 4px;
    }

    .sin-stats__title {
        font-size: 0.9rem;
        padding: 12px 16px;
    }

    .sin-stats__label {
        font-size: 0.65rem;
    }
}

@media (max-width: 360px) {
    .sin-widget {
        --sin-ball-size: 28px;
        --sin-ball-font-size: 11px;
        --sin-ball-gap: 5px;
    }

    /* Много малки екрани - още по-малки stat топчета */
    .sin-stats__balls { gap: 6px; }

    .sin-stat-ball {
        width: 36px;
        height: 52px;
    }

    .sin-stat-ball__num {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .sin-stats__block { padding: 12px; }
}

/* Desktop - malo veće kuglice */
@media (min-width: 1200px) {
    .sin-widget {
        --sin-ball-size: 38px;
        --sin-ball-font-size: 15px;
        --sin-ball-gap: 10px;
    }
}
