/**
 * Inkora Breaking News Ticker - Frontend Styles
 * Version: 1.0.0
 */

/* =========================================================
   CSS Custom Properties
   ========================================================= */
:root {
  --inkora-primary:          #2398bc;
  --inkora-text:             #ffffff;
  --inkora-accent:           #ffd700;
  --inkora-title-bg:         #1a1a2e;
  --inkora-border-radius:    4px;
}

/* =========================================================
   Ticker Animations
   ========================================================= */
@keyframes ticker-scroll-left {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-33.33%); }
}

@keyframes ticker-scroll-right {
    0%   { transform: translateX(-33.33%); }
    100% { transform: translateX(0); }
}

@keyframes pulse {
    0%   { opacity: 1; }
    50%  { opacity: 0.6; }
    100% { opacity: 1; }
}

/* =========================================================
   Base Ticker Layout
   ========================================================= */
.inkora-breaking-ticker {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0 auto 15px;
    min-height: 50px;
    background: var(--inkora-primary);
}

/* Pause on hover */
.inkora-breaking-ticker:hover .inkora-ticker-scroll {
    animation-play-state: paused !important;
}

/* Speed display (hidden, kept for debugging hooks) */
.inkora-breaking-ticker::before {
    display: none;
}

/* =========================================================
   Ticker Label
   ========================================================= */
.inkora-ticker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 100%;
    font-weight: 700;
    white-space: nowrap;
    z-index: 2;
    flex-shrink: 0;
    background-color: var(--inkora-title-bg);
    color: var(--inkora-text);
    border-top-left-radius: var(--inkora-border-radius);
    border-bottom-left-radius: var(--inkora-border-radius);
}

.inkora-ticker-icon {
    font-size: 14px;
    animation: pulse 1.5s infinite;
}

.inkora-ticker-icon.dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* =========================================================
   Content Wrapper & Scroll
   ========================================================= */
.inkora-ticker-content-wrapper {
    flex: 1;
    overflow: hidden;
    padding: 0 15px;
    position: relative;
    height: 100%;
}

.inkora-ticker-scroll {
    display: flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* =========================================================
   Ticker Items
   ========================================================= */
.inkora-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    flex-shrink: 0;
}

.inkora-ticker-category {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background-color: var(--inkora-accent);
    color: #000;
}

.inkora-category-tag {
    margin-right: 2px;
}

.inkora-ticker-link {
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
    color: var(--inkora-text);
}

.inkora-ticker-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

.inkora-ticker-time {
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--inkora-text);
    opacity: 0.8;
}

.inkora-ticker-time .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.inkora-ticker-separator {
    font-size: 16px;
    margin-left: 5px;
    opacity: 0.7;
}

/* =========================================================
   Controls
   ========================================================= */
.inkora-ticker-controls {
    padding: 0 15px;
    display: flex;
    gap: 8px;
    z-index: 2;
    flex-shrink: 0;
}

.inkora-ticker-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.inkora-ticker-controls button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    padding-bottom: 19px;
}

.inkora-ticker-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.inkora-ticker-controls button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* =========================================================
   Dashicons General
   ========================================================= */
.dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* =========================================================
   Style Variants
   ========================================================= */

/* Classic */
.inkora-ticker-classic {
    border: 2px solid #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.inkora-ticker-classic .inkora-ticker-label {
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Modern */
.inkora-ticker-modern {
    box-shadow: none;
}

.inkora-ticker-modern .inkora-ticker-label {
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
}

.inkora-ticker-modern .inkora-ticker-label::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 13px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 10px solid var(--inkora-title-bg);
}

/* Minimal */
.inkora-ticker-minimal {
    border-bottom: 2px solid var(--inkora-accent);
    box-shadow: none;
}

.inkora-ticker-minimal .inkora-ticker-label {
    background: transparent !important;
    color: var(--inkora-accent) !important;
    font-weight: 600;
}

/* Gradient */
.inkora-ticker-gradient {
    background: linear-gradient(90deg, var(--inkora-primary), var(--inkora-accent)) !important;
}

.inkora-ticker-gradient .inkora-ticker-label {
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(5px);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 768px) {
    .inkora-breaking-ticker {
        flex-direction: column;
        align-items: stretch;
    }

    .inkora-ticker-label {
        width: 100%;
        border-radius: var(--inkora-border-radius) var(--inkora-border-radius) 0 0 !important;
        text-align: center;
        justify-content: center;
    }

    .inkora-ticker-content-wrapper {
        width: 100%;
    }

    .inkora-ticker-controls {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.5);
        border-radius: 20px;
        padding: 5px;
    }
}

@media (max-width: 480px) {
    .inkora-ticker-category {
        display: none;
    }

    .inkora-ticker-time {
        font-size: 10px;
    }

    .inkora-ticker-link {
        font-size: 12px;
    }
}

/* =========================================================
   Accessibility
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .inkora-ticker-scroll {
        animation: none !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .inkora-breaking-ticker {
        overflow-x: auto;
    }
}

@media (prefers-contrast: high) {
    .inkora-breaking-ticker {
        border: 2px solid currentColor;
    }

    .inkora-ticker-category {
        border: 1px solid currentColor;
    }
}