/* DIGIrabbits News Ticker - Frontend Styles */

/* Base Wrapper */
.drnt-ticker-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    font-family: inherit;
}

.drnt-ticker-wrapper * {
    box-sizing: border-box;
}

/* Label */
.drnt-ticker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 2;
    flex-shrink: 0;
}

.drnt-label-icon {
    font-size: 1.2em;
}

/* Ticker Container */
.drnt-ticker-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Ticker Content */
.drnt-ticker-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Ticker Items */
.drnt-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
}

.drnt-ticker-item a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.drnt-ticker-item a:hover {
    text-decoration: underline;
}

.drnt-item-image {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.drnt-item-date {
    opacity: 0.7;
    font-size: 0.9em;
    flex-shrink: 0;
}

.drnt-item-title {
    flex-shrink: 0;
}

/* Separator */
.drnt-separator {
    padding: 0 15px;
    opacity: 0.5;
}

/* Controls */
.drnt-ticker-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    flex-shrink: 0;
}

.drnt-control {
    background: transparent;
    border: 1px solid currentColor;
    opacity: 0.5;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 3px;
    transition: opacity 0.3s ease;
    color: inherit;
}

.drnt-control:hover {
    opacity: 1;
}

/* ================================
   HORIZONTAL TICKER STYLES
   ================================ */

.drnt-horizontal {
    flex-direction: row;
}

.drnt-horizontal .drnt-ticker-container {
    mask-image: linear-gradient(to right, transparent, black 30px, black calc(100% - 30px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 30px, black calc(100% - 30px), transparent);
}

/* Horizontal Marquee Animation */
.drnt-horizontal.drnt-style-marquee .drnt-ticker-content {
    animation: drnt-marquee-horizontal var(--drnt-duration, 20s) linear infinite;
}

.drnt-horizontal.drnt-style-marquee:hover .drnt-ticker-content {
    animation-play-state: var(--drnt-hover-state, paused);
}

@keyframes drnt-marquee-horizontal {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Horizontal Slide Animation */
.drnt-horizontal.drnt-style-slide .drnt-ticker-content {
    transition: transform 0.5s ease;
}

.drnt-horizontal.drnt-style-slide .drnt-ticker-item {
    position: absolute;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease;
}

.drnt-horizontal.drnt-style-slide .drnt-ticker-item.active {
    position: relative;
    opacity: 1;
    transform: translateX(0);
}

/* ================================
   VERTICAL TICKER STYLES
   ================================ */

.drnt-vertical {
    flex-direction: column;
}

.drnt-vertical .drnt-ticker-label {
    justify-content: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.drnt-vertical .drnt-ticker-container {
    mask-image: linear-gradient(to bottom, transparent, black 20px, black calc(100% - 20px), transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 20px, black calc(100% - 20px), transparent);
}

.drnt-vertical .drnt-ticker-content {
    flex-direction: column;
    white-space: normal;
}

.drnt-vertical .drnt-ticker-item {
    width: 100%;
    padding: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.drnt-vertical .drnt-ticker-item:last-child {
    border-bottom: none;
}

.drnt-vertical .drnt-separator {
    display: none;
}

/* Vertical Marquee Animation */
.drnt-vertical.drnt-style-marquee .drnt-ticker-content {
    animation: drnt-marquee-vertical var(--drnt-duration, 15s) linear infinite;
}

.drnt-vertical.drnt-style-marquee:hover .drnt-ticker-content {
    animation-play-state: var(--drnt-hover-state, paused);
}

@keyframes drnt-marquee-vertical {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* Vertical Slide Animation */
.drnt-vertical.drnt-style-slide .drnt-ticker-content {
    position: relative;
}

.drnt-vertical.drnt-style-slide .drnt-ticker-item {
    position: absolute;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.5s ease;
}

.drnt-vertical.drnt-style-slide .drnt-ticker-item.active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
}

/* ================================
   FADE ANIMATION STYLE
   ================================ */

.drnt-style-fade .drnt-ticker-content {
    position: relative;
}

.drnt-style-fade .drnt-ticker-item {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    text-align: center;
    justify-content: center;
}

.drnt-style-fade .drnt-ticker-item.active {
    position: relative;
    opacity: 1;
}

.drnt-style-fade .drnt-separator {
    display: none;
}

/* ================================
   TYPING ANIMATION STYLE
   ================================ */

.drnt-style-typing .drnt-ticker-content {
    position: relative;
}

.drnt-style-typing .drnt-ticker-item {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    opacity: 0;
    text-align: center;
    justify-content: center;
}

.drnt-style-typing .drnt-ticker-item.active {
    position: relative;
    opacity: 1;
}

.drnt-style-typing .drnt-item-title {
    overflow: hidden;
    border-right: 2px solid currentColor;
    white-space: nowrap;
    animation: drnt-typing 3s steps(40, end), drnt-blink-caret 0.75s step-end infinite;
}

.drnt-style-typing .drnt-separator {
    display: none;
}

@keyframes drnt-typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes drnt-blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: currentColor; }
}

/* ================================
   HOVER EFFECTS
   ================================ */

.drnt-ticker-item a {
    position: relative;
}

.drnt-ticker-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.drnt-ticker-item a:hover::after {
    width: 100%;
}

.drnt-ticker-item a:hover {
    text-decoration: none;
}

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

@media (max-width: 768px) {
    .drnt-ticker-wrapper {
        font-size: 13px;
    }
    
    .drnt-ticker-label {
        padding: 8px 12px;
    }
    
    .drnt-ticker-item {
        padding: 8px 12px;
    }
    
    .drnt-item-image {
        width: 24px;
        height: 24px;
    }
    
    .drnt-ticker-controls {
        display: none;
    }
}

@media (max-width: 480px) {
    .drnt-horizontal .drnt-ticker-label {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .drnt-label-icon {
        display: none;
    }
}

/* ================================
   ACCESSIBILITY
   ================================ */

@media (prefers-reduced-motion: reduce) {
    .drnt-ticker-content,
    .drnt-ticker-item,
    .drnt-item-title {
        animation: none !important;
        transition: none !important;
    }
}

/* Screen Reader Only */
.drnt-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
.drnt-ticker-item a:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.drnt-control:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
}

/* ================================
   LOADING STATE
   ================================ */

.drnt-ticker-wrapper.drnt-loading {
    min-height: 50px;
}

.drnt-ticker-wrapper.drnt-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: drnt-spin 0.8s linear infinite;
}

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

/* ================================
   DARK MODE SUPPORT
   ================================ */

@media (prefers-color-scheme: dark) {
    .drnt-ticker-wrapper {
        /* Colors will be overridden by inline styles, but provide fallback */
    }
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    .drnt-ticker-wrapper {
        display: none !important;
    }
}
