/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', sans-serif;
    line-height: 1.6;
}

/* Variables for color scheme */
:root {
    --primary: #605daf;
    --success: #5dd099;
    --info: #33cdff;
    --text-light: #ffffff;
    --separator-color: rgba(255, 255, 255, 0.7);
    --bar-height: 40px;
    --bar-background: var(--primary);
}

/* Main content area (to demonstrate the fixed bar) */
.main-content {
    min-height: 100vh;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Dummy content styling */
.dummy-content {
    margin-top: 30px;
    margin-bottom: 50px;
}

.dummy-content h2 {
    color: #333;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.content-section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.content-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.content-section p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.content-section ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
}

.event-card {
    background-color: white;
    border-left: 4px solid var(--primary);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.event-card h4 {
    color: var(--primary);
    margin-bottom: 10px;
}

.event-card p {
    margin-bottom: 5px;
}

/* Control Panel Toggle Button */
.control-panel-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
}

.control-panel-toggle:hover {
    background-color: #4f4c9a;
}

.toggle-icon {
    margin-right: 5px;
    font-size: 16px;
}

/* Control Panel */
.control-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 300px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 20px;
    z-index: 1001;
    font-family: 'Rubik', sans-serif;
    display: none; /* Hidden by default */
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.control-panel.active {
    display: block;
}

.control-panel h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--primary);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.control-group input[type="color"] {
    width: 100%;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.control-group input[type="text"] {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Rubik', sans-serif;
}

.control-group input[type="checkbox"] {
    margin-right: 5px;
    transform: scale(1.2);
}

.control-group select {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Rubik', sans-serif;
    background-color: white;
    height: 32px;
}

.control-group textarea {
    width: 100%;
    height: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    resize: vertical;
    margin-bottom: 5px;
    background-color: #f8f8f8;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    background-color: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-small:hover {
    background-color: #e0e0e0;
}

.control-group span {
    font-size: 12px;
    color: #777;
}

.buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #4f4c9a;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.preset-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-preset {
    flex: 1;
    padding: 6px 10px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-preset:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.btn-preset.preset1 {
    border-left: 4px solid #3f51b5; /* Indigo */
}

.btn-preset.preset2 {
    border-left: 4px solid #009688; /* Teal */
}

.btn-preset.preset3 {
    border-left: 4px solid #673ab7; /* Deep Purple */
}

/* Scrolling bar container */
.scroll-tv-bar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bar-height);
    background-color: var(--bar-background);
    color: var(--text-light);
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Hidden state for the bar */
.scroll-tv-bar-container.hidden {
    transform: translateY(100%);
}

/* Hidden state for scroll threshold */
.scroll-tv-bar-container.scroll-threshold-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Enhanced smooth transition class */
.scroll-tv-bar-container.smooth-transition {
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

/* Scrolling content */
.scroll-tv-bar-content {
    position: absolute;
    white-space: nowrap;
    height: 100%;
    line-height: var(--bar-height);
    /* Initial position (will be animated by JS) */
    transform: translateX(90%); /* Start closer to view for faster appearance */
    transition: transform 0.2s ease; /* Smooth initial appearance */
}

/* Draggable state */
.scroll-tv-bar-content.draggable {
    cursor: grab;
    user-select: none;
}

.scroll-tv-bar-content.dragging {
    cursor: grabbing;
    transition: none; /* Disable transition during dragging for immediate response */
}

/* Item styling */
.scroll-tv-bar-item {
    display: inline-block;
    padding: 0 5px;
    font-size: 16px;
}

/* Separator styling */
.scroll-tv-bar-separator {
    display: inline-block;
    margin: 0 15px;
    color: var(--separator-color);
    font-weight: 300;
}

/* Link styling */
.scroll-tv-bar-content a {
    color: var(--info);
    text-decoration: none;
    transition: color 0.2s ease;
}

.scroll-tv-bar-content a:hover {
    color: var(--success);
    text-decoration: underline;
}

/* Settings button styling */
.settings-button {
    position: fixed;
    left: 20px;
    bottom: 8px; /* Position it in the middle of the bar */
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-family: 'Rubik', sans-serif;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002; /* Higher than the bar to stay on top */
    transition: background-color 0.2s;
}

.settings-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Settings dropdown menu */
.settings-dropdown {
    position: fixed;
    left: 20px;
    bottom: 45px; /* Position above the settings button */
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 1003;
    display: none; /* Hidden by default */
    font-family: 'Rubik', sans-serif;
    min-width: 180px;
}

.settings-dropdown.active {
    display: block;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #333;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: #f0f0f0;
}

/* Info button styling */
.info-button {
    position: fixed;
    right: 20px;
    bottom: 8px; /* Position it in the middle of the bar */
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-family: 'Rubik', sans-serif;
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002; /* Higher than the bar to stay on top */
    transition: background-color 0.2s;
}

.info-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Show bar button styling */
.show-bar-button {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 24px;
    height: 24px;
    border-radius: 4px 4px 0 0;
    background-color: var(--primary);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-bottom: none;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: background-color 0.2s, transform 0.3s ease;
    transform: translateY(100%);
}

.show-bar-button:hover {
    background-color: #4f4c9a;
}

.show-bar-button.visible {
    display: flex;
    transform: translateY(0);
}

/* Notification styling */
.scroll-tv-bar-notification {
    position: fixed;
    bottom: 60px; /* Position above the scrolling bar */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    z-index: 1010;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.scroll-tv-bar-notification.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
