/**
 * Newsticker Frontend - MOBILE FIRST
 * Optimiert für mobile Endgeräte
 * Design: Rot, Blau, Schwarz, Grau
 */

/* ===== CSS VARIABLEN ===== */
:root {
    --color-red: #c41e3a;
    --color-blue: #1976d2;
    --color-black: #000000;
    --color-dark-gray: #1a1a1a;
    --color-gray: #333333;
    --color-medium-gray: #4a4a4a;
    --color-light-gray: #f5f5f5;
    --color-white: #ffffff;
    --color-border: #d0d0d0;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
}

/* ===== RESET & BASE (MOBILE FIRST) ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-black);
    background: var(--color-light-gray);
    min-height: 100vh;
    overflow-x: hidden;
    font-weight: 400;
}

/* ===== HEADER (MOBILE) ===== */
.header {
    background: linear-gradient(135deg, var(--color-red) 0%, #8b0000 100%);
    color: var(--color-white);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-content {
    padding: 0 var(--spacing-md);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.header-left h1 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.logo-icon {
    font-size: 24px;
    margin-right: 8px;
}

.header-subtitle {
    font-size: 11px;
    opacity: 1;
    font-weight: 500;
    margin-top: 2px;
}

/* Buttons kompakt für Mobile */
.header-buttons {
    display: flex;
    gap: var(--spacing-xs);
}

.btn-notification,
.btn-auto-refresh {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-notification:active,
.btn-auto-refresh:active {
    transform: scale(0.95);
}

.btn-notification.active {
    background: var(--color-white);
    color: #4caf50;
}

.btn-notification.disabled {
    background: rgba(100, 100, 100, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.btn-notification.blocked {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.5);
}

.btn-auto-refresh.active {
    background: var(--color-white);
    color: var(--color-red);
}

.btn-auto-refresh.active .refresh-icon {
    animation: spin 1s linear infinite;
}

.btn-notification.active .notification-icon {
    animation: ring 2s ease infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50%, 90% { transform: rotate(0deg); }
}

/* Notification/Refresh icons */
.notification-icon,
.refresh-icon {
    font-size: 16px;
}

/* Text in Buttons - auf Mobile minimiert */
.notification-text,
.refresh-text {
    display: none;
}

.refresh-status {
    font-size: 11px;
    font-weight: 700;
}

/* Last Update - kompakt */
.last-update {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.update-label {
    font-weight: 700;
    opacity: 1;
}

.update-time {
    font-weight: 600;
}

/* ===== STATS BAR (MOBILE) ===== */
.stats-bar {
    /*display: none;*/
    background: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-around;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-red);
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: var(--color-gray);
    font-weight: 600;
    margin-top: 2px;
}

/* ===== BREAKING NEWS BANNER (MOBILE) ===== */
.breaking-news {
    background: linear-gradient(90deg, var(--color-red) 0%, #d32f2f 100%);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.breaking-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.breaking-badge {
    background: var(--color-white);
    color: var(--color-red);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    animation: pulse 2s infinite;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.breaking-badge i {
    font-size: 12px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.breaking-text {
    font-size: 13px;
    font-weight: 700;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== MAIN CONTENT (MOBILE) ===== */
.container {
    padding: var(--spacing-md);
    max-width: 100%;
}

/* ===== NEWS ITEMS (MOBILE OPTIMIERT) ===== */
.news-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.news-item {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-item.pinned {
    border-left: 4px solid var(--color-red);
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
    gap: var(--spacing-sm);
}

.news-meta {
    flex: 1;
}

.news-date {
    font-size: 12px;
    color: var(--color-medium-gray);
    font-weight: 600;
    margin-bottom: 2px;
}

.news-date i,
.news-time i {
    margin-right: 4px;
    font-size: 11px;
}

.news-time {
    font-size: 12px;
    color: var(--color-medium-gray);
    font-weight: 600;
    margin: 0 12px 2px;
}

.date-icon {
    margin-right: 4px;
}

.news-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--color-blue) 0%, #1565c0 100%);
    color: var(--color-white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
}

.news-location i {
    font-size: 11px;
}

.location-icon {
    font-size: 12px;
}

.news-badge {
    background: linear-gradient(135deg, var(--color-red) 0%, #d32f2f 100%);
    color: var(--color-white);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
    animation: pulse 2s infinite;
}

.badge-pinned {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--color-red) 0%, #d32f2f 100%);
    color: var(--color-white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.badge-pinned i {
    font-size: 10px;
}

.news-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-black);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.news-item.pinned .news-title {
    color: var(--color-red);
}

.news-content {
    font-size: 15px;
    color: var(--color-dark-gray);
    line-height: 1.6;
}

.news-content p {
    margin-bottom: var(--spacing-sm);
}

.news-content p:last-child {
    margin-bottom: 0;
}

.news-content ul,
.news-content ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.news-content strong {
    color: var(--color-red);
    font-weight: 800;
}

.news-content em {
    font-style: italic;
    color: var(--color-gray);
    font-weight: 500;
}

/* ===== MEDIA EMBEDS (BILDER, VIDEOS, SOCIAL MEDIA) ===== */

/* Bilder in News-Content */
.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: var(--spacing-md) 0;
    display: block;
}

.media-image {
    margin: var(--spacing-md) 0;
}

.media-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Video/Iframe Embeds */
.media-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin: var(--spacing-md) 0;
    border-radius: 8px;
    background: #000;
}

.media-embed iframe,
.media-embed .media-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
}

/* YouTube Embeds */
.media-embed-youtube {
    background: #000;
}

/* Twitter/X Embeds */
.media-embed-twitter {
    padding-bottom: 0;
    height: auto;
}

.media-embed-twitter .twitter-tweet {
    margin: 0 auto !important;
}

/* Instagram Embeds */
.media-embed-instagram {
    padding-bottom: 0;
    height: auto;
    max-width: 540px;
    margin: var(--spacing-md) auto;
}

/* Vimeo Embeds */
.media-embed-vimeo {
    background: #000;
}

/* Responsive Media Queries für Embeds */
@media (max-width: 600px) {
    .media-embed {
        margin: var(--spacing-sm) calc(var(--spacing-md) * -1);
        border-radius: 0;
    }
    
    .media-image {
        margin: var(--spacing-sm) calc(--spacing-md) * -1);
    }
    
    .media-image img {
        border-radius: 0;
    }
}

/* ===== BUTTONS & ACTIONS (MOBILE) ===== */
.load-more-container {
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.btn-load-more {
    background: linear-gradient(135deg, var(--color-blue) 0%, #1565c0 100%);
    color: var(--color-white);
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    min-width: 200px;
}

.btn-load-more:active {
    transform: scale(0.95);
}

.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--color-red) 0%, #d32f2f 100%);
    color: var(--color-white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:active {
    transform: scale(0.9);
}

/* ===== LOADING & EMPTY STATES (MOBILE) ===== */
.loading-spinner {
    text-align: center;
    padding: var(--spacing-lg);
}

.spinner {
    border: 3px solid var(--color-light-gray);
    border-top: 3px solid var(--color-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-lg);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
    color: var(--color-medium-gray);
    opacity: 0.5;
}

.empty-state-icon i {
    font-size: 64px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--color-dark-gray);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.empty-state p {
    font-size: 14px;
    color: var(--color-gray);
    font-weight: 500;
}

/* ===== CONNECTION STATUS (MOBILE) ===== */
.connection-status {
    background: #ff5722;
    color: var(--color-white);
    padding: var(--spacing-sm);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    display: none;
}

.connection-status.offline {
    display: block;
}

/* ===== NOTIFICATION HINTS (MOBILE) ===== */
.notification-hint {
    position: fixed;
    top: 70px;
    left: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.notification-hint.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-hint-content {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--spacing-md);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    border-left: 4px solid var(--color-blue);
}

.notification-hint-content.hint-success {
    border-left-color: #4caf50;
}

.notification-hint-content.hint-error {
    border-left-color: #f44336;
}

.notification-hint-content.hint-warning {
    border-left-color: #ff9800;
}

.hint-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.hint-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-dark-gray);
}

.hint-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-black);
}

.hint-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.hint-close:active {
    background: var(--color-light-gray);
}

/* ===== TABLET (ab 600px) ===== */
@media (min-width: 600px) {
    :root {
        --spacing-md: 20px;
        --spacing-lg: 24px;
    }
    
    .header-content {
        padding: 0 var(--spacing-lg);
    }
    
    .header-left h1 {
        font-size: 24px;
    }
    
    .header-subtitle {
        font-size: 13px;
    }
    
    .btn-notification,
    .btn-auto-refresh {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Text in Buttons anzeigen */
    .notification-text,
    .refresh-text {
        display: inline;
    }
    
    .stats-bar {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 13px;
        font-weight: 600;
    }
    
    .container {
        padding: var(--spacing-lg);
    }
    
    .news-item {
        padding: var(--spacing-lg);
    }
    
    .news-title {
        font-size: 20px;
        font-weight: 800;
    }
    
    .news-content {
        font-size: 16px;
        color: var(--color-dark-gray);
    }
    
    .notification-hint {
        left: auto;
        right: var(--spacing-lg);
        max-width: 400px;
    }
}

/* ===== DESKTOP (ab 1024px) ===== */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 32px;
    }
    
    .header-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 32px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .header-top {
        flex: 1;
        margin-bottom: 0;
    }
    
    .header-buttons {
        gap: var(--spacing-sm);
    }
    
    .last-update {
        margin-top: 0;
        margin-left: var(--spacing-lg);
    }
    
    .news-container {
        gap: 20px;
    }
    
    .news-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    .btn-load-more:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
    }
    
    .scroll-top:hover {
        transform: scale(1.1);
    }
}

/* ===== LARGE DESKTOP (ab 1440px) ===== */
@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
    }
    
    .header-content {
        max-width: 1400px;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --color-light-gray: #1a1a1a;
        --color-border: #333;
    }
    
    body {
        background: #0f0f0f;
    }
    
    .news-item {
        background: #1e1e1e;
        color: #f0f0f0;
    }
    
    .news-title {
        color: #ffffff;
        font-weight: 800;
    }
    
    .news-content {
        color: #e5e5e5;
    }
    
    .news-date, .news-time {
        color: #b0b0b0;
    }
    
    .stats-bar {
        background: #1e1e1e;
    }
    
    .stat-label {
        color: #b0b0b0;
    }
    
    .empty-state h3 {
        color: #e5e5e5;
    }
    
    .empty-state p {
        color: #b0b0b0;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus states für Keyboard-Navigation */
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--color-blue);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .header-buttons,
    .btn-load-more,
    .scroll-top,
    .breaking-badge,
    .notification-hint {
        display: none !important;
    }
    
    .news-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
