/* Global Styles */
:root {
    --primary-color: #5865F2;  /* Discord Blue */
    --secondary-color: #2c2f33;
    --text-color: #ffffff;
    --bg-color: #36393f;
    --card-bg: #2f3136;
    --hover-color: #7289da;
    --border-color: #202225;
    --font-size: 16px;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Animation properties */
    --pulse-color: rgba(88, 101, 242, 0.6);
    --glow-color: rgba(114, 137, 218, 0.6);
    --flow-color-1: rgba(88, 101, 242, 0.8);
    --flow-color-2: rgba(114, 137, 218, 0.8);
    
    /* Card styles */
    --modern-gradient: linear-gradient(135deg, #7289da, #5865F2);
    --discord-gradient: linear-gradient(135deg, #5865F2, #2c2f33);
}

/* Glowing title animation */
@keyframes titleGlow {
    0% {
        text-shadow: 0 0 5px rgba(88, 101, 242, 0.7), 0 0 10px rgba(88, 101, 242, 0.5);
    }
    50% {
        text-shadow: 0 0 10px rgba(88, 101, 242, 1), 0 0 20px rgba(88, 101, 242, 0.8), 0 0 30px rgba(88, 101, 242, 0.6);
    }
    100% {
        text-shadow: 0 0 5px rgba(88, 101, 242, 0.7), 0 0 10px rgba(88, 101, 242, 0.5);
    }
}

/* Glowing title styling */
.glow-title {
    text-decoration: underline;
    color: var(--text-color);
    animation: titleGlow 2s infinite;
    -webkit-animation: titleGlow 2s infinite; /* For Safari */
    text-decoration-color: var(--primary-color);
    text-decoration-thickness: 2px;
    transition: color 0.3s;
    font-weight: bold;
    /* Fallback for browsers that might not support text-shadow animation */
    position: relative;
    display: inline-block;
}

.glow-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(8px);
    background-color: rgba(88, 101, 242, 0.3);
    opacity: 0;
    border-radius: 4px;
    animation: blurGlow 2s infinite;
    -webkit-animation: blurGlow 2s infinite;
}

@keyframes blurGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@-webkit-keyframes blurGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.glow-title:hover {
    color: var(--primary-color);
    text-shadow: 0 0 15px rgba(88, 101, 242, 1);
}

/* Style for action buttons in header */
.btn-action {
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1rem;
    border: none;
}

.btn-action:hover {
    background-color: var(--hover-color);
}

.import-label {
    margin: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: var(--font-size);
}

body.with-bg-image::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: var(--bg-opacity, 0.2);
    z-index: -1;
}

body.with-bg-image {
    background-color: var(--bg-color);
    position: relative;
    z-index: 0;
    background-image: none !important; /* Move the actual image to the pseudo-element */
}

header {
    background-color: var(--secondary-color);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

h1, h2, h3 {
    margin-bottom: 0.5rem;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    background-color: var(--secondary-color);
    color: var(--text-color);
    transition: all 0.2s ease;
}

button.active, button:hover {
    background-color: var(--primary-color);
}

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

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

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

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

.btn.small {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

main {
    padding: 2rem;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 0.5rem;
}

.mode-container {
    display: none;
}

.mode-container.active {
    display: block;
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Timeline Styles */
.timeline-container {
    position: relative;
    padding: 3rem 0;
}

.timeline-line {
    position: absolute;
    top: 50px;
    bottom: 50px;
    left: 50%;
    width: 4px;
    background-color: var(--primary-color);
    transform: translateX(-50%);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(88, 101, 242, 0.3);
}

/* Timeline decorations */
.timeline-decoration {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timeline-decoration.top {
    top: 0;
}

.timeline-decoration.bottom {
    bottom: 0;
}

.timeline-start-icon, .timeline-end-icon {
    background-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.5);
}

/* Timeline animations */
.timeline-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.timeline-line.pulse .timeline-pulse {
    background: linear-gradient(to bottom, transparent, var(--pulse-color), transparent);
    animation: pulse 3s infinite;
}

.timeline-line.glow {
    box-shadow: 0 0 20px var(--glow-color);
    animation: glow 3s infinite alternate;
}

.timeline-line.flow .timeline-pulse {
    background: linear-gradient(to bottom, 
        transparent 0%, 
        var(--flow-color-1) 25%, 
        var(--flow-color-2) 50%, 
        var(--flow-color-1) 75%, 
        transparent 100%);
    animation: flow 10s infinite linear;
    height: 200%;
    top: -50%;
}

@keyframes pulse {
    0% {
        opacity: 0.2;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.2;
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 10px var(--glow-color);
    }
    100% {
        box-shadow: 0 0 25px var(--glow-color), 0 0 40px var(--glow-color);
    }
}

@keyframes flow {
    0% {
        transform: translateY(-50%);
    }
    100% {
        transform: translateY(50%);
    }
}

.timeline-events {
    position: relative;
}

.timeline-event {
    position: relative;
    margin-bottom: 2rem;
    width: calc(50% - 2rem);
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
}

/* Event card styles */
.timeline-event.modern {
    background: var(--modern-gradient);
}

.timeline-event.gradient {
    background: linear-gradient(135deg, var(--card-bg), var(--secondary-color));
    border-left: 5px solid var(--primary-color);
}

.timeline-event.discord {
    background: var(--discord-gradient);
    border-top: 4px solid var(--primary-color);
}

/* Event animations */
.timeline-event.bounce {
    animation: bounce 0.5s;
}

.timeline-event.fade {
    animation: fade 0.8s;
}

.timeline-event.slide {
    animation: slide 0.5s;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.timeline-event:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.timeline-event.left {
    float: left;
    clear: both;
}

.timeline-event.right {
    float: right;
    clear: both;
}

.timeline-event::after {
    content: '';
    position: absolute;
    top: 20px;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    /* Fix circle positioning to be centered on the line */
    transform: translateX(-50%);
    z-index: 3;
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.2);
}

.timeline-event.left::after {
    right: -32px; /* Adjusted position */
    transform: translateX(50%);
}

.timeline-event.right::after {
    left: -37px; /* Move it back to better match the center line */
    transform: translateX(-25%); /* Add partial translation to fine-tune position */
}

/* Left-aligned timeline style */
.timeline-left .timeline-line {
    left: 40px;
}

.timeline-left .timeline-decoration {
    left: 40px;
}

.timeline-left .timeline-event {
    width: calc(100% - 80px);
    float: right;
    margin-left: 80px;
}

.timeline-left .timeline-event::after {
    left: -22px;
}

/* Right-aligned timeline style */
.timeline-right .timeline-line {
    left: calc(100% - 40px);
}

.timeline-right .timeline-decoration {
    left: calc(100% - 40px);
}

.timeline-right .timeline-event {
    width: calc(100% - 80px);
    float: left;
    margin-right: 80px;
}

.timeline-right .timeline-event::after {
    right: -22px;
}

.timeline-event-content {
    position: relative;
}

.event-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.event-date {
    color: #b9bbbe;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.event-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.event-description {
    margin-top: 0.5rem;
    color: #dcddde;
}

/* Image Gallery */
.event-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.event-image-thumbnail {
    width: calc(33.333% - 0.35rem);
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-image-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.image-gallery {
    position: relative;
    margin: 1rem 0;
}

.gallery-images {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image.active {
    opacity: 1;
}

.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.gallery-prev, .gallery-next {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.8rem;
    margin: 0 0.5rem;
}

.gallery-indicators {
    display: flex;
    gap: 0.5rem;
}

.gallery-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.gallery-indicator.active {
    background-color: var(--primary-color);
}

/* Time indicators between events */
.time-indicator {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    font-size: 0.85rem;
    color: var(--text-color);
    background-color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    z-index: 4;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 80px;
    margin: 0;
    /* Fixed width to ensure consistent appearance */
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-left .time-indicator {
    left: 40px;
    transform: translateY(-50%);
}

.timeline-right .time-indicator {
    left: calc(100% - 40px);
    transform: translateY(-50%);
}

/* Panel Overlay Styles */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 500;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}

.panel-overlay.active {
    display: flex;
}

.panel-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    animation: panelFadeIn 0.3s ease;
}

@keyframes panelFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    margin: 0;
    font-size: 1.5rem;
}

.panel-close {
    background: none;
    padding: 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color);
}

.panel-close:hover {
    color: var(--primary-color);
}

.panel-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Edit Mode Styles */
.edit-panel, .settings-panel {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
}

input, textarea, select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    font-family: inherit;
}

input[type="color"] {
    padding: 0.2rem;
    height: 40px;
    cursor: pointer;
}

input[type="range"] {
    padding: 0;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.import-label {
    display: inline-block;
    margin-bottom: 0;
    cursor: pointer;
}

/* Image Input Styles */
#imageInputsContainer {
    margin-bottom: 1rem;
}

.image-input-group {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
    position: relative;
}

.image-input-group:last-child {
    margin-bottom: 0;
}

.image-input-tabs {
    display: flex;
    background-color: var(--border-color);
}

.image-tab-btn {
    background: none;
    border-radius: 0;
    padding: 0.5rem 1rem;
    flex: 1;
    border-bottom: 3px solid transparent;
}

.image-tab-btn.active {
    background-color: var(--card-bg);
    border-bottom: 3px solid var(--primary-color);
}

.image-input-content {
    padding: 1rem;
}

.image-input {
    display: none;
}

.image-input.active {
    display: block;
}

.image-preview {
    margin-top: 0.5rem;
    max-height: 150px;
    overflow: hidden;
    border-radius: 4px;
    display: none;
}

.image-preview img {
    width: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    z-index: 2;
}

/* Empty timeline message */
.empty-timeline-message {
    text-align: center;
    padding: 2rem;
    color: #b9bbbe;
    font-style: italic;
}

.event-list {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--secondary-color);
    border-radius: 4px;
}

.event-item-info {
    flex-grow: 1;
}

.event-item-actions {
    display: flex;
    gap: 0.5rem;
}

.event-item-actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.delete-btn {
    background-color: #ed4245;
}

.delete-btn:hover {
    background-color: #f57173;
}

/* Settings Styles */
.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Import/Export Section */
.import-export-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.8rem;
    cursor: pointer;
}

.close:hover {
    color: var(--hover-color);
}

#modalDate {
    color: #b9bbbe;
    font-style: italic;
}

/* Clear fixes */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

.image-order-controls {
    display: flex;
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 2;
}

.image-order-controls button {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.8rem;
    margin: 0 2px;
}

.image-order-controls button:hover {
    background-color: var(--primary-color);
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    color: var(--text-color);
    font-size: 0.9rem;
    position: relative;
    padding-left: 30px;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.helper-text {
    font-size: 0.85rem;
    color: #b9bbbe;
    margin-top: 0.5rem;
    font-style: italic;
}

.bg-image-preview {
    margin-top: 0.5rem;
    max-height: 150px;
    overflow: hidden;
    border-radius: 4px;
    display: none;
}

.bg-image-preview img {
    width: 100%;
    object-fit: cover;
    max-height: 150px;
}

.file-input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: var(--text-color);
} 