:root {
    /* Light mode colors (default) */
    --table-text-color: #333;
    --table-border-color: #ddd;
    --table-header-bg: #f5f5f5;
    --table-row-even-bg: #ffffff;
    --table-row-odd-bg: #f9f9f9;
    --table-row-hover: #f0f0f0;
}

/* Comparison title styles */
.comparison-title {
    color: var(--table-text-color);
    margin: 2rem 0 1rem;
    font-size: 1.75rem;
    font-weight: 600;
}

/* Base table styles */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    color: var(--table-text-color);
    background-color: var(--table-row-odd-bg);
}

.comparison-table th,
.comparison-table td {
    border: 1px solid var(--table-border-color);
    padding: 12px;
    text-align: left;
}

.comparison-table th {
    background-color: var(--table-header-bg);
    font-weight: bold;
}

.comparison-table tr:nth-child(even) {
    background-color: var(--table-row-even-bg);
}

.comparison-table tr:nth-child(odd) {
    background-color: var(--table-row-odd-bg);
}

.comparison-table tr:hover {
    background-color: var(--table-row-hover);
}

/* Dark mode styles */
.dark-mode {
    --table-text-color: #e0e0e0;
    --table-border-color: #444;
    --table-header-bg: #2d2d2d;
    --table-row-even-bg: #1e1e1e;
    --table-row-odd-bg: #252525;
    --table-row-hover: #363636;
}

/* Conclusions list styles - updated to match table theme */
.dark-mode+.comparison-conclusions {
    --table-text-color: #e0e0e0;
}

.comparison-conclusions {
    color: var(--table-text-color);
    list-style: none;
    padding-left: 20px;
    margin-top: 1rem;
}

.comparison-conclusions li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.comparison-conclusions li::before {
    content: "*";
    position: absolute;
    left: 0;
}

code {
    background: #f4f4f4;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: block;
    white-space: pre-wrap;
    margin: 10px 0;
}

pre {
    background: #f4f4f4;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow-x: auto;
}

.formula {
    font-size: 1.2em;
    font-weight: bold;
    background: #f9f9f9;
    padding: 10px;
    border-left: 5px solid #4caf50;
    margin: 10px 0;
    display: inline-block;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table,
th,
td {
    border: 1px solid #ddd;
    padding: 8px;
}

th {
    background-color: #f2f2f2;
    text-align: left;
}

#progress-container {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 5px;
    overflow: hidden;
    height: 10px;
    margin: 20px 0;
    position: relative;
    cursor: pointer;
}

#progress-bar {
    height: 100%;
    width: 0;
    background-color: #007bff;
    transition: width 0.1s linear;
}

.highlight {
    color: red;
    font-weight: bold;
}

#transcription-raw {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
    background-color: #f5f5f5;
}

.timestamp {
    color: #666;
}

#current-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    max-width: 80%;
    z-index: 1000;
    display: none;
}

#audio-container {
    position: sticky;
    top: 0;
    background: white;
    padding: 10px 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #ddd;
}

.toggle-transcript {
    cursor: pointer;
    color: #0066cc;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.toggle-transcript:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

.hidden {
    display: none;
}

/* Transcript-specific styles */
#transcription-raw.transcript-container {
    padding: 1rem;
}

#transcription-raw .transcript-line {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

#transcription-raw .timestamp {
    color: #666;
    margin-right: 1rem;
    font-family: monospace;
}

#transcription-raw .transcript-text {
    display: inline;
    white-space: normal;
}

#transcription-raw .transcript-text.highlight {
    background-color: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
}

#current-text.current-text-overlay {
    position: fixed;
    bottom: 20px;
    color: #007bff;
    z-index: 1000;
    text-align: center;
    display: flex;
    font-size: 1.1em;
    line-height: 1.4;
    padding: 0 20px;
    pointer-events: none;
    white-space: normal;
    max-height: 5.6em;
    /* Changed from 2.8em to 5.6em (4 lines * 1.4 line-height) */
    overflow: hidden;
    width: 80%;
    margin-left: 50%;
    transform: translateX(-50%);
    /* Center horizontally */
    align-items: center;
    justify-content: center;
}

/* Ensure the element is positioned relative to viewport */
body #current-text.current-text-overlay {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 20px !important;
}

#current-text.current-text-overlay:empty {
    display: none;
}

.animate__animated {
    animation-delay: var(--animate-delay);
}

/* Theme Color Dots */
.theme-colors {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
}

.color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-dot.active {
    border-color: #fff;
    transform: scale(1.2);
}

.color-dot.red {
    background-color: #d4000e;
}

.color-dot.blue {
    background-color: #40a9ff;
}

.color-dot.dark-blue {
    background-color: #1a237e;
}

.color-dot.orange {
    background-color: #ff8800;
}

.color-dot.green {
    background-color: #00C851;
}

.color-dot.purple {
    background-color: #aa66cc;
}

.stagger-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}


.stagger-background-01 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}


.stagger-background-02 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}


.stagger-background-03 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}


.stagger-background-04 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}


.stagger-background-05 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}

/* Different shapes for variety */
.stagger-box {
    position: absolute;
    pointer-events: none;
}

.stagger-box.circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.stagger-box.square {
    width: 25px;
    height: 25px;
    border-radius: 4px;
}

.stagger-box.triangle {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 26px solid;
    background: transparent;
}

.stagger-box.diamond {
    width: 25px;
    height: 25px;
    transform: rotate(45deg);
}

.stagger-box.star {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 26px solid;
    position: relative;
}

.stagger-box.star:after {
    content: '';
    position: absolute;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 26px solid;
    top: 8px;
    left: -15px;
}

/* Add gradient effect for some shapes */
.stagger-box.gradient {
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.4), rgba(72, 219, 251, 0.4));
}

/* Add glow effect */
.stagger-box.glow {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Add rainbow effect */
.stagger-box.rainbow {
    animation: rainbow 8s linear infinite;
}

@keyframes rainbow {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

/* Audio Playlist Styles */
.audio-playlist-container {
    text-align: center;
    margin: 20px 0;
}

.audio-popup-btn {
    background: #373737;
    color: #ffc266;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.audio-popup-btn:hover {
    background: #464646;
}

.audio-popup-btn i {
    font-size: 16px;
}

/* Flashcard styles */
.flashcards-container {
    padding: 2rem;
    background-color: var(--table-row-odd-bg);
}

.flashcards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.flashcard {
    perspective: 1000px;
    height: 250px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard:hover .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 2px;
    background-color: var(--table-row-even-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.flashcard-back {
    transform: rotateY(180deg);
}

.flashcard .block-title-1 {
    background-color: #2196F3;
    padding: 8px 15px;
    margin: 0;
}

.flashcard .block-title-1 h3 {
    color: #ffffff;
    font-size: 1rem;
    margin: 0;
    text-align: left;
}

.flashcard .panel-body {
    flex: 1;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flashcard .panel-body p {
    margin: 0;
    text-align: left;
    color: var(--table-text-color);
}

.flashcard-back .panel-body p {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.flashcard-back h4 {
    margin-bottom: 15px;
}

/* Carousel controls */
.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.prev-btn,
.next-btn {
    padding: 1rem 1.5rem;
    background-color: var(--table-header-bg);
    color: var(--table-text-color);
    border: 2px solid var(--table-border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.prev-btn:hover,
.next-btn:hover {
    background-color: var(--table-row-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.prev-btn i,
.next-btn i {
    font-size: 1.2rem;
}

.preserve-case {
    text-transform: none !important;
}

/* Label styles for algorithm links */
[class^="label-"] {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.typography-section .container .flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.typography-section .container .flex>span {
    display: inline-block;
    margin-bottom: 1rem;
}

/* Usage grid styles */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    padding: 20px;
}

.usage-card {
    background: var(--table-row-even-bg);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    color: var(--table-text-color);
}

.usage-card .explanation {
    padding: 20px;
}

/* Dark mode support */
.dark-mode .usage-card {
    background: var(--table-row-even-bg);
}

/* List styles for usage section */
.list.list-mark-1 {
    list-style: none;
    padding-left: 20px;
}

.list.list-mark-1 li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.list.list-mark-1 li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--table-text-color);
}

/* Section styles */
.mb-8 {
    margin-bottom: 1rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.font-semibold {
    font-weight: 600;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Code block styles */
.code-block {
    position: relative;
    margin-bottom: 20px;
}

.code-block h5 {
    color: var(--table-text-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-block pre {
    background: var(--table-header-bg);
    border: 1px solid var(--table-border-color);
}

.code-block code {
    color: var(--table-text-color);
}

.copy-button {
    cursor: pointer;
    font-size: 0.9em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.copy-button:hover {
    opacity: 1;
}

/* Dark mode support */
.dark-mode .code-block pre {
    background: var(--table-header-bg);
}

.dark-mode .code-block code {
    color: var(--table-text-color);
}

/* Concept grid and card styles */
.concepts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.concept-card {
    background: var(--table-row-even-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.concept-card .panel-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

.concept-card .panel-body p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    color: white;
}

.concept-card .cta-link {
    display: inline-flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.1);
}

.concept-card .cta-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .concepts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .concept-card .panel-body {
        min-height: 160px;
        padding: 1.25rem;
    }

    .concept-card .panel-body p {
        font-size: 0.9375rem;
        margin-bottom: 1.25rem;
    }
}

/* Concept toggle and tooltip styles */
.concept-toggle {
    cursor: pointer;
    margin-left: 10px;
    color: var(--table-text-color);
    position: relative;
}

.concept-toggle.completed {
    color: var(--table-text-color);
}

.concept-toggle[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -30px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    text-transform: lowercase;
    z-index: 1000;
}

/* Link styles */
.colab-link {
    margin-left: 10px;
    color: var(--table-text-color);
    text-decoration: none;
}

.colab-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -30px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    text-transform: lowercase;
    z-index: 1000;
}

.scikit-link {
    margin-left: 10px;
    color: var(--table-text-color);
    text-decoration: none;
}

.scikit-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -30px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    text-transform: lowercase;
    z-index: 1000;
}

/* Algorithm toggle styles */
.algorithm-toggle {
    cursor: pointer;
    margin-left: 10px;
    color: var(--table-text-color);
    position: relative;
    font-size: 1.2rem;
    vertical-align: middle;
}

.algorithm-toggle.completed {
    color: var(--table-text-color);
}

.algorithm-toggle[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -30px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    text-transform: lowercase;
    z-index: 1000;
}

/* AI Generated Images Styles */
.ai-images-container {
    padding: 3rem 1rem;
    margin: 0 auto;
    max-width: 1200px;
}

.ai-images-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 56rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .ai-images-container {
        padding: 0.25rem 1rem;
    }

    .ai-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.image-card {
    padding: 1rem;
    overflow: hidden;
}

.image-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
}

.ai-generated-image {
    width: 100%;
    transform: rotate(-6deg);
    transition: transform 700ms ease-in-out;
}

.ai-generated-image:hover {
    transform: rotate(6deg) scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 1rem;
    background-color: rgba(31, 41, 55, 0.7);
}

.prompt-title {
    font-size: 1.25rem;
    color: white;
    font-weight: 700;
}

.prompt-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: rgb(209, 213, 219);
}

/* Pictured text styles */
.pictured-text {
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.2;
    display: inline-block;
    margin: 0.5rem 0;
    font-weight: bold;
}

/* White text for pictured text inside block-title-1 */
.block-title-1 .pictured-text {
    color: white;
    opacity: 0.9;
    /* Slightly softer white for better readability */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    /* Add subtle shadow for better contrast */
}

@media (max-width: 768px) {
    .pictured-text {
        font-size: 0.8rem;
    }
}

/* Civitai link styles */
.civitai-link:hover {
    background: #357abd !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.civitai-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Admin Edit Button Styles */
.admin-edit-btn {
    text-decoration: none;
    margin-left: 8px;
    cursor: pointer;
    position: relative;
    padding: 5px;
    display: inline-block;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.admin-edit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-edit-btn i {
    font-size: 20px !important;
    display: block;
}

.admin-edit-btn i:hover {
    color: #ffdb99 !important;
}

.admin-edit-btn.edit-mode i {
    color: #ffdb99 !important;
}

/* Tooltip styles */
.admin-edit-btn[title]:hover:after {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 100;
    margin-top: 5px;
}

/* Title with edit button styles */
.title-with-edit {
    display: flex;
    align-items: center;
    gap: 15px;
}

.title-with-edit span {
    margin: 0;
}

.paragraph-feather-icon {
    margin-right: 10px;
    color: #ffc266;
    vertical-align: middle;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s, color 0.3s;
}

.paragraph-feather-icon:hover {
    transform: scale(1.2);
    color: #ffaa33;
}

.big-gallery {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    position: relative;
}

.big-gallery .gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.big-gallery .image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    /* Optional: adds a black background */
    overflow: hidden;
}

.big-gallery img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Changed from cover to contain */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.play-icon {
    position: absolute;
    z-index: 1;
    /* Add your play icon styling here */
}

.author-social-links {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    z-index: 100;
}

.author-social-links .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    opacity: 1 !important;
    transition: transform 0.2s ease;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: visible;
}

.author-social-links .social-icon:hover {
    transform: scale(1.1) translateZ(0);
}

.author-social-links .social-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

.author-name {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

/* Ensure carousel items maintain proper stacking context */
.owl-carousel .owl-item {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* Ensure carousel transitions don't affect icon visibility */
.owl-carousel .owl-item.active .author-social-links {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force hardware acceleration for smoother transitions */
.post-content {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Prevent any unwanted opacity transitions */
.owl-carousel .owl-item * {
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
}

/* Modal styles */
.modal-dialog.modal-lg {
    width: 95%;
    max-width: 1200px;
    margin: 30px auto;
}

.modal-content {
    background-color: #fff;
    border: none;
    border-radius: 2px;
    box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
}

.modal-header.block-title-1 {
    border-bottom: none;
    padding: 15px 20px;
    border-radius: 2px 2px 0 0;
}

.modal-body {
    max-height: calc(90vh - 210px);
    overflow-y: auto;
    padding: 20px;
    background-color: #fff;
}

.gallery-banner {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border-radius: 2px;
    overflow: hidden;
}

.gallery-image {
    position: relative;
    width: 100%;
    padding-top: 42.85%;
    /* Adjusted for a wider aspect ratio */
}

.gallery-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #f5f5f5;
}

.typography-section {
    border-bottom: none;
    margin: 0;
    padding: 0;
}

.typography-section .introduction {
    margin-bottom: 20px;
}

.modal-footer {
    border-top: 1px solid #e5e5e5;
    padding: 15px 20px;
    text-align: right;
}

/* Ensure modal appears on top */
#llm-popup {
    z-index: 1050;
}

/* Adjust modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.in {
    opacity: 0.8;
}


/* Typography improvements */
.typography-section p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 1em;
}

.typography-section .title-style01 {
    margin: 1.5em 0 1em;
}

.typography-section ul.list-mark-1 {
    margin-bottom: 1.5em;
}

.typography-section ul.list-mark-1 li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

/* YouTube button styling */
.btn-youtube {
    background-color: #ff0000;
    color: #ffffff !important;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 3px;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-youtube:hover {
    background-color: #d90000;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
}

.btn-youtube:active {
    transform: translateY(0);
}

.btn-youtube .fa {
    font-size: 18px;
    margin-right: 8px;
    position: relative;
    top: 1px;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 24px;
}

.mb-4 {
    margin-bottom: 24px;
}

/* Modal close button styling */
.modal-close {
    float: right;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.8;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    position: absolute;
    right: 15px;
    top: 12px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.modal-close:hover {
    opacity: 1;
    color: #fff;
}

.modal-close span {
    font-size: 28px;
}

/* Footer close button styling */
.btn-close {
    background-color: #6c757d;
    color: #fff;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 3px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-close:hover {
    background-color: #5a6268;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
}

.btn-close:active {
    transform: translateY(0);
}

.modal-header {
    position: relative;
    padding: 15px 20px;
}

/* Play icon in text styling */
.play-icon {
    background: transparent;
    color: inherit;
    border-radius: 0;
    padding: 0;
    margin: 0 4px;
    opacity: 0.8;
    cursor: pointer;
    font-size: inherit;
    position: static;
    display: inline;
    left: auto;
    top: auto;
}

.play-icon:hover {
    opacity: 1;
    background: transparent;
}

/* Ensure icon doesn't affect line height */
button.play-icon {
    border: none;
    vertical-align: baseline;
    line-height: inherit;
}

button.play-icon i {
    font-size: inherit;
}

/* Override any existing play-icon styles */
.play-icon::before {
    content: none;
}

/* Button link reset */
.btn-link {
    border: none;
    padding: 0;
    background: none;
    vertical-align: baseline;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: none;
}

/* Ensure icon doesn't affect line height */
.play-icon i {
    font-size: inherit;
    vertical-align: middle;
}

/* Override any existing play-icon styles */
.play-icon::before {
    content: none !important;
}

.featured-title {
    font-size: 24px;
    font-weight: normal;
    color: #333;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.featured-card {
    border-radius: 4px;
    overflow: hidden;
    padding: 25px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.featured-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.featured-content p {
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.featured-content .cta-link {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.featured-content .cta-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.featured-content .cta-link .arrow {
    margin-left: 8px;
}

@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .featured-card {
        min-height: 180px;
        padding: 20px;
    }

    .featured-content p {
        font-size: 15px;
        margin-bottom: 15px;
    }
}

/* Tech Trending Section Styles */
.tech-trending {
    margin-bottom: 0;
    /* Remove margin from tech-trending */
}

.tech-trending-title {
    font-size: 24px;
    font-weight: normal;
    color: #333;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.tech-trending-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    /* Add consistent margin to the grid */
}

.tech-trending-tile {
    border-radius: 4px;
    overflow: hidden;
    padding: 25px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tech-trending-tile p {
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.tech-trending-tile .cta-link {
    display: inline-flex;
    align-items: center;
    color: #fff !important;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.tech-trending-tile .cta-link:hover {
    background: rgba(0, 0, 0, 0.3) !important;
    /* Darker overlay for better contrast */
    border-color: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

/* Featured Updates Section Styles */
.featured-title {
    margin-top: 40px;
    /* Add top margin to create space */
}

@media (max-width: 768px) {
    .tech-trending-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 15px;
        /* Smaller margin on mobile */
    }

    .tech-trending-tile {
        min-height: 180px;
        padding: 20px;
    }

    .tech-trending-tile p {
        font-size: 15px;
        margin-bottom: 15px;
    }

    .featured-title {
        margin-top: 30px;
        /* Slightly less space on mobile */
    }
}


@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 50vh;
    overflow: hidden;
    margin: 0 0 2rem 0;
    padding: 0;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-dots {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 20px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
    background: white;
}

.stagger-background-01,
.stagger-background-02,
.stagger-background-03,
.stagger-background-04,
.stagger-background-05 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}