/* This Day in History Styles */
.tdih-container {
    margin: 15px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.tdih-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0073aa;
    color: #23282d;
    font-weight: 600;
}

.tdih-current-date {
    background: #0073aa;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.95em;
}

.tdih-scroll-container {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: #fafafa;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tdih-events-wrapper {
    height: 100%;
    overflow-y: auto;
    padding: 15px;
    scroll-behavior: smooth;
}

.tdih-event {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #0073aa;
    transition: all 0.3s ease;
    position: relative;
}

.tdih-event:hover {
    background: #f8fbfe;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.tdih-year {
    font-weight: 700;
    color: #0073aa;
    font-size: 1.1em;
    margin-bottom: 8px;
    display: inline-block;
    padding: 3px 8px;
    background: #e7f3ff;
    border-radius: 4px;
}

.tdih-description {
    line-height: 1.5;
    color: #333;
    font-size: 0.95em;
}

.tdih-error {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    color: #856404;
    text-align: center;
}

/* Scroll Controls */
.tdih-scroll-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 8px 5px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.85em;
}

.tdih-prev-btn,
.tdih-next-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    flex: 1;
    margin: 0 3px;
    max-width: 100px;
}

.tdih-prev-btn:hover,
.tdih-next-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.tdih-prev-btn:active,
.tdih-next-btn:active {
    transform: translateY(0);
}

.tdih-prev-btn:disabled,
.tdih-next-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.tdih-scroll-indicator {
    color: #666;
    font-style: italic;
    flex: 2;
    text-align: center;
    font-size: 0.8em;
}

.tdih-paused .tdih-scroll-indicator {
    color: #999;
    font-style: normal;
}

/* Responsive button styles */
@media (max-width: 768px) {
    .tdih-scroll-controls {
        flex-direction: row;
        gap: 5px;
    }
    
    .tdih-prev-btn,
    .tdih-next-btn {
        padding: 8px 5px;
        font-size: 0.8em;
        max-width: none;
    }
    
    .tdih-scroll-indicator {
        font-size: 0.75em;
    }
}

/* Scrollbar Styling */
.tdih-events-wrapper::-webkit-scrollbar {
    width: 8px;
}

.tdih-events-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tdih-events-wrapper::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.tdih-events-wrapper::-webkit-scrollbar-thumb:hover {
    background: #005a87;
}

/* Pause indicator */
.tdih-paused::after {
    content: "⏸ Paused";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 10;
    pointer-events: none;
}

/* Widget specific styles */
.widget_tdih_widget .tdih-container {
    margin: 0;
}

.widget_tdih_widget .tdih-title {
    font-size: 1.2em;
    margin-bottom: 8px;
}

.widget_tdih_widget .tdih-scroll-controls {
    padding: 5px 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tdih-event {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .tdih-year {
        font-size: 1em;
    }
    
    .tdih-description {
        font-size: 0.9em;
    }
    
    .tdih-scroll-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .tdih-prev-btn,
    .tdih-next-btn {
        width: 100%;
        padding: 8px;
    }
}

/* Loading state */
.tdih-loading {
    opacity: 0.7;
    pointer-events: none;
}