
body {
    --category-1: #c2a792;
    --category-2: #a0b9a6;
    --category-3: #b0a0c0;
    --category-4: #c0b090;
}

/* Timeline Container */
.timeline-container {
    position: relative;
    height: 400px;
    overflow: visible;
    border-width: 5px;
    border-color: var(--fog-color);
    margin-bottom: 50px;
}

.timeline-scroll {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden !important;
    cursor: grab;
    padding: 18rem 0 3rem;
    padding-left: 100px;
    padding-right: 100px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.timeline-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.timeline-scroll.grabbing {
    cursor: grabbing;
}

.timeline-border {
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.timeline-border.left {
    left: 0;
    background: linear-gradient(to right, var(--fog-color), transparent);
}

.timeline-border.right {
    right: 0;
    background: linear-gradient(to left, var(--fog-color), transparent);
}

.timeline-track {
    position: absolute;
    top: 75%;
    transform: translateY(-50%);
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
}

/* Timeline Markers */
.timeline-marker {
    position: absolute;
    top: -8px;
    width: 4px;
    height: 20px;
    background-color: var(--accent);
    border-radius: 2px;
    transform: translateX(-50%);
    pointer-events: none;
}

.timeline-marker-hitbox {
    position: absolute;
    width: 16px;
    height: 40px;
    top: -18px;
    left: -6px;
    pointer-events: auto;
    background: transparent;
    cursor: pointer;
}

.timeline-dot {
    position: absolute;
    top: 75%;
    width: 20px;
    height: 20px;
    background-color: var(--bg-primary);
    border: 3px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.timeline-date-popup {
    position: absolute;
    left: 50%;
    top: 0px;
    width: 80px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--accent);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.timeline-date-popup.showing {
    opacity: 1;
    transform: translate(-50%, 30px);
}

.timeline-date-popup.hiding {
    opacity: 0;
    transform: translate(-50%, 10px);
}

.timeline-feature {
    position: absolute;
    top: -90px;
    transform: translateX(-50%);
    z-index: 1;
    cursor: pointer;
}

.timeline-feature,
.feature {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-feature.dimmed,
.feature.dimmed {
    opacity: 0.2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Timeline bubble stays centered and scales properly */
.timeline-feature.highlighted {
    transform: translateX(-50%) scale(1.1);
    z-index: 10;
}

/* Grid feature scales normally without translate shift */
.feature.highlighted {
    transform: scale(1.05);
    z-index: 5;
}

.feature-bubble {
    position: absolute;
    width: 45px;
    height: 45px;
    transform: translateX(-50%);
    border-radius: 50%;
    background-color: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--accent);
    transition: all 0.3s ease;
    z-index: 11;
}

.feature-bubble::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,10 l10,-10 l10,10 l-10,10 z' stroke='%23b0a090' fill='none' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
    opacity: 0.1;
    z-index: 2;
    border-radius: 50%;
}

.feature-bubble:hover {
    transform: scale(1.5) translateX(-33%);
    border-color: var(--accent);
}

.feature-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary); /* fallback bg color */
}

.feature-icon img,
.feature-icon svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.feature-connector {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    width: 4px;
    height: 20px;
    background-color: var(--accent);
    z-index: 0;
}

/* Feature Popup */
.feature-popup {
    position: absolute;
    top: -180px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    width: 280px;
    background-color: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.timeline-feature:hover .feature-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.feature-popup::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--bg-primary);;
}

.popup-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--accent-light);
}

.popup-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.popup-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.popup-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.popup-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.popup-status {
    display: flex;
    align-items: center;
}

.status-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
}

.status-dot-bubble {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transform: translateY(125%);
}

/* Timeline Controls */
#timeline-scroll-left,
#timeline-scroll-right{
    position: absolute;
    cursor: pointer;
    z-index: 15;
    pointer-events: auto;
    top: 50%;
}

#timeline-scroll-right{
    right: 40px;
}

.timeline-btn {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 15;
    pointer-events: auto;
}


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

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 0.5rem;
}

.filter-btn {
    position: relative; /* Remove absolute */
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--accent);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center; /* Center text horizontally */
    gap: 0.5rem;
    z-index: 1;
}

.filter-btn.active {
    background-color: var(--accent);
    color: var(--text-primary);
}

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

/* Feature Grid */
.grid-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature {
    background-color: var(--bg-primary);;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--accent-light);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

.feature-title {
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.feature-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.feature-subject {
    font-weight: 600;
    font-size: 1.2rem;
}

.feature-date {
    font-size: 0.75rem;
}

.feature-status {
    display: flex;
    font-weight: 600;
    justify-content: center;
    align-items: center;
    gap: 6px; /* optional: spacing between dot and text */
}

.feature-card-icon-holder {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.feature-card-icon {
    height: 50%;
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.feature-card-content,
.feature-floating-card-content {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--bg-primary);;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 250px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease;
    z-index: 20;
}

.feature-floating-card-content {
    position: absolute;
    transform: translateX(-50%) translateY(-110%);
}

.feature-card-content {
    min-height: 300px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--bg-primary);;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    background-color: rgba(176, 160, 144, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--accent-light);
}

.modal-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-category {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-content {
    margin-bottom: 1.5rem;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--accent-light);
}

.modal-meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.meta-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Category colors */
.category-1 {
    background-color: var(--category-1);
    color: white;
}

.category-2 {
    background-color: var(--category-2);
    color: white;
}

.category-3 {
    background-color: var(--category-3);
    color: white;
}

.category-4 {
    background-color: var(--category-4);
    color: white;
}

.marker-line,
.today-marker-line {
    position: absolute;
    width: 0px;
    height: 600px;
    top: -400px;
    border-left: 9px dashed var(--accent);
    left: -3px;
    opacity: 0.3; 
    z-index: 3;
}

.today-dot {
    width: 30px;
    height: 30px;
    background-color: var(--accent);
    border: 5px solid var(--bg-primary);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 1.5s infinite;
    z-index: 5;
}

.today-date-popup {
    position: absolute;
    left: -40px;
    top: 30px;
    width: 80px;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-secondary);
    background-color: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    opacity: 1;
    z-index: 8;
}

.today-marker {
    position: absolute;
    top: -100px;
    width: 1px;
    height: 200px;
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
    z-index: 5;
}

.today-marker-line {
    opacity: 0.7;
}

.month-text,
.month-text-left,
.month-text-right {
    position: absolute;
    top: 75%;
    font-size: 2rem;
    font-weight: 600;
    width: 250px;
    color: var(--text-primary);
    opacity: 0.3;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
}

.month-text-left {
    transform: translateX(calc(-105% - 8px));
    text-align: right;
}

.month-text-right {
    transform: translateX(5%);
    text-align: left;
}

.feature-grid-item {
  background-color: var(--bg-primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 1rem;
  text-align: center;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

.feature-grid-item:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.feature-grid-item .feature-card-icon-holder {
  width: 80px;
  height: 80px;
  margin: 0 auto 0.5rem;
}

.feature-grid-item .feature-card-icon-holder img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  display: block;
}

.feature-grid-item .feature-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* Hidden by default, shown on hover */
.feature-grid-item .feature-description {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.feature-grid-item:hover .feature-description {
  opacity: 1;
  max-height: none;
  overflow: visible;
}

.feature-grid-item.expanded .feature-description {
  opacity: 1;
  max-height: none;
  overflow: visible;
}

.outlined-text {
  text-shadow:
    -1px -1px 0 white,
     1px -1px 0 white,
    -1px  1px 0 white,
     1px  1px 0 white;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(var(--accent-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .grid-section {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 576px) {
    .timeline-feature {
        top: -80px;
    }

    .feature-bubble {
        width: 50px;
        height: 50px;
    }

    .feature-popup {
        width: 240px;
    }
}