/* Global styles */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Timeline styles */
.timeline-container {
    position: relative;
    padding-top: 40px;
    padding-left: 20px;
    padding-right: 20px;
}

.timeline-line {
    position: absolute;
    left: 20px;
    width: 2px;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.3), rgba(79, 70, 229, 0.3));
    top: 0;
    bottom: 0;
    z-index: 0;
}

.dark .timeline-line {
    background: linear-gradient(to bottom, rgba(96, 165, 250, 0.3), rgba(139, 92, 246, 0.3));
}

.timeline-dot {
    position: absolute;
    left: 0;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6, #4F46E5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.25);
}

.dark .timeline-dot {
    background: linear-gradient(135deg, #60A5FA, #8B5CF6);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

/* Toggle switch */
.toggle-container {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.example-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.toggle-label-before {
    margin-right: 0.5rem;
    color: #EF4444;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.toggle-label-after {
    margin-left: 0.5rem;
    color: #10B981;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.dark .toggle-label-before {
    color: #F87171;
}

.dark .toggle-label-after {
    color: #34D399;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: all 0.3s ease-in-out;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: all 0.3s ease-in-out;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #3B82F6, #4F46E5);
}

.dark input:checked + .toggle-slider {
    background: linear-gradient(135deg, #60A5FA, #8B5CF6);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Highlight active label */
input:not(:checked) ~ .toggle-label-before,
input:checked ~ .toggle-label-after,
.toggle-container input:not(:checked) ~ .toggle-label-before,
.toggle-container input:checked ~ .toggle-label-after,
.example-header input:not(:checked) ~ .toggle-label-before,
.example-header input:checked ~ .toggle-label-after {
    transform: scale(1.1);
    text-shadow: 0 0 1px currentColor;
}

/* Example containers */
.example-container {
    transition: opacity 0.3s ease-in-out;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.example-visible {
    max-height: 2000px;
    opacity: 1;
    margin: 1rem 0;
    padding: 1rem 0;
}

.sin-container {
    scroll-margin-top: 80px;
    margin-bottom: 5rem;
    padding-left: 30px;
}

.content-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dark .content-card {
    background: #1F2937;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.content-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.dark .content-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
}

.example-background {
    background: #F9FAFB;
    border-radius: 0.75rem;
}

.dark .example-background {
    background: #374151;
}

.solution-box {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0.01));
    border-left: 4px solid #3B82F6;
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.dark .solution-box {
    background: linear-gradient(to right, rgba(96, 165, 250, 0.1), rgba(96, 165, 250, 0.02));
    border-left: 4px solid #60A5FA;
}

.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.gradient-bg {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(79, 70, 229, 0.05));
}

.dark .gradient-bg {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.4), rgba(91, 33, 182, 0.4));
}

.gradient-heading {
    background: linear-gradient(135deg, #3B82F6, #4F46E5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.dark .gradient-heading {
    background: linear-gradient(135deg, #60A5FA, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.hero-gradient {
    background: linear-gradient(135deg, #3B82F6, #4F46E5);
}

.dark .hero-gradient {
    background: linear-gradient(135deg, #1E40AF, #5B21B6);
} 

/* Base styles for all content cards */
.content-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

/* Layout control for sin descriptions */
@media (min-width: 1024px) {
    .timeline-line {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .timeline-dot {
        left: 50%;
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
    
    .sin-container {
        padding-left: 0;
        margin-bottom: 7rem;
    }
    
    /* Force a consistent order in the grid regardless of HTML structure */
    .sin-container .grid {
        display: grid;
    }
}


/* create css for viewports of 1024px and below */
@media (max-width: 1023px) {
    .timeline-container {
        padding: 0;
    }
    .timeline-line{
        display: none;
    }
    .sin-container {
        padding-left: 0px;
        border-radius: 1rem;
        /* box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05); */
        margin-bottom: 2rem;
    }
    .content-card {
        box-shadow: none;
        margin-bottom: 0;
        border-radius: 0;
    }

    .grid .content-card:last-child {
        border-radius: 0 0 1rem 1rem;
    }

    .toggle-label-before{
        display: none;
    }
    .toggle-label-after{
        display: none;
    }

    .timeline-dot {
        position: relative;
        left: 0;
        transform: none;
        width: 100%;
        height: 40px;
        border-radius: 1rem 1rem 0 0;
    }
    .example-visible {
        margin: 0;
        padding: 0;
    }
}
