/* Course Viewer Styles */
:root {
    --primary-color: #2b8a83;
    --secondary-color: #1e6b65;
}

.course-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1201px) {
    .course-layout {
        grid-template-columns: 320px 1fr;
        gap: 2.5rem;
    }
}

/* Allow course container to expand for better list visibility on large screens */
body.bg-light .container.py-xl {
    max-width: 1750px;
    width: 98%;
}

.course-content-area {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

/* Sidebar Navigation */
.course-sidebar {
    position: sticky;
    top: 90px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

.course-sidebar::-webkit-scrollbar {
    width: 10px;
    /* Thicker for better visibility */
}

.course-sidebar::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 10px;
}

.course-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    border: 3px solid #f8fafc;
    /* Border for better visibility of the thumb */
}

@media (max-width: 1200px) {
    .course-layout {
        grid-template-columns: 1fr;
    }

    .course-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hide off-screen completely */
        width: 320px;
        height: 100vh;
        z-index: 1000;
        transition: right 0.3s ease-out;
        border-radius: 0;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    }

    .course-sidebar.open {
        right: 0;
    }
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0 1.5rem;
    height: 54px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-full);
    border: none;
    box-shadow: 0 8px 25px rgba(43, 138, 131, 0.4);
    z-index: 1001;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-nav-toggle:active {
    transform: scale(0.95);
}

.mobile-nav-toggle i {
    font-size: 1.2rem;
}

@media (max-width: 1200px) {
    .mobile-nav-toggle {
        display: flex;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.visible {
    display: block;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
}

.sidebar-header-mobile {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(43, 138, 131, 0.1);
}

@media (max-width: 1200px) {
    .sidebar-header-mobile {
        display: flex;
    }

    .sidebar-title {
        border-bottom: none;
        padding-bottom: 0;
    }
}

.sidebar-close-btn {
    background: rgba(43, 138, 131, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
    background: rgba(43, 138, 131, 0.2);
    transform: rotate(90deg);
}

.course-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.course-nav-list li {
    margin-bottom: 0.5rem;
}

.course-nav-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-weight: 600;
    border-right: 3px solid transparent;
}

.course-nav-list a.nav-link:hover {
    background: rgba(43, 138, 131, 0.05);
    color: var(--primary-color);
}

.course-nav-list li.active>a.nav-link {
    background: rgba(43, 138, 131, 0.1);
    color: var(--primary-color);
    border-right-color: var(--primary-color);
}

/* Accordion Specific */
.has-submenu .toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.has-submenu .toggle-icon::before {
    content: "▼";
}

.has-submenu.open>a .toggle-icon {
    transform: rotate(180deg);
}

.sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    padding-right: 1.5rem;
    margin-top: 0.2rem;
}

.has-submenu.open .sub-menu {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sub-menu a {
    padding: 0.5rem 0.8rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-right: 2px solid transparent;
    opacity: 0.9;
    font-weight: 500;
}

.sub-menu li.active a {
    color: var(--secondary-color);
    border-right-color: var(--secondary-color);
    font-weight: 700;
}

.sub-menu a:hover {
    color: var(--primary-color);
}

/* Main Content Area */
.course-content-area {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

@media (max-width: 768px) {
    .course-content-area {
        padding: 1.5rem;
    }
}

.course-chapter-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(43, 138, 131, 0.1);
    text-align: center;
}

.course-chapter-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.course-chapter-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Slide Sections (Accordion Style) */
.slide-section {
    margin-bottom: 0;
    padding-top: 0;
    border-bottom: 1px solid var(--border-color);
}

.slide-section:last-child {
    border-bottom: none;
}

.slide-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    position: relative;
    padding-right: 1.5rem;
}

/* Accordion Header Override */
.slide-title.collapsible-header {
    cursor: pointer;
    margin-bottom: 0;
    padding: 1.5rem 0;
    font-size: 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    transition: color 0.3s ease;
    padding-right: 0;
}

.slide-title.collapsible-header:hover {
    color: var(--neon-blue);
}

.slide-title.collapsible-header::before {
    display: none;
}

/* Chevron Icon */
.slide-title.collapsible-header::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b8a83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* Removed obsolete nav-sub-item styles */

.slide-section.active .slide-title.collapsible-header {
    color: var(--primary-color);
    padding-bottom: 1rem;
}

.slide-section.active .slide-title.collapsible-header::after {
    transform: rotate(180deg);
}

/* Smooth Accordion Animation using CSS Grid */
.slide-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-section.active .slide-content-wrapper {
    grid-template-rows: 1fr;
}

.slide-content {
    overflow: hidden;
}

.slide-content-inner {
    padding-bottom: 2rem;
    padding-top: 0.5rem;
}

.slide-text {
    font-size: 1.15rem;
    line-height: 2;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 900px;
    /* Constrain text for readability while allowed container is wide */
}

/* Info Boxes */
.info-box {
    background: #f8fafc;
    border-right: 4px solid var(--primary-color);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    max-width: 900px;
}

.info-box.highlight {
    background: rgba(43, 138, 131, 0.05);
}

.info-box.alert-style {
    background: rgba(220, 252, 231, 0.5);
    /* Light green */
    border-color: #22c55e;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 992px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.app-card {
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.app-card h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-card ul li {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 0.8rem;
    position: relative;
    padding-right: 1.2rem;
}

.app-card ul li::before {
    content: '•';
    color: var(--neon-blue);
    position: absolute;
    right: 0;
    font-weight: bold;
}

/* Prompts Grid */
.prompts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.prompt-card {
    display: flex;
    align-items: center;
    background: #f0fdfa;
    /* light teal */
    border: 1px solid rgba(43, 138, 131, 0.2);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.prompt-card:hover {
    background: #e6fcf8;
    transform: translateX(-5px);
}

.prompt-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.prompt-details h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.prompt-details p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Course Tables */
.course-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.course-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
}

.course-table th {
    background: var(--primary-color);
    color: white;
    padding: 1.2rem;
    text-align: right;
    font-weight: 700;
}

.course-table td {
    background: white;
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    vertical-align: top;
    line-height: 1.8;
}

.course-table tr:last-child td {
    border-bottom: none;
}

.course-table tr:hover td {
    background: #f8fafc;
}

/* Vertical Comparison Table (Category-based) */
.v-comparison-table {
    min-width: 0 !important;
}

.v-comparison-table th:first-child,
.v-comparison-table td:first-child {
    width: 150px;
    background: #f8fafc;
    font-weight: 800;
    color: var(--primary-color);
    border-left: 1px solid var(--border-color);
    text-align: center;
}

.v-comparison-table .weak-col {
    color: var(--text-secondary);
    background: #fffcfc;
}

.v-comparison-table .strong-col {
    background: #f0fdf4;
    /* Light green for the positive example */
    border-right: 2px solid #22c55e;
    font-weight: 500;
}

.v-comparison-table .category-header {
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.8rem !important;
}

/* Responsive Stack Table (No-Scroll Mobile View) */
@media (max-width: 900px) {
    .course-table-wrapper.no-scroll {
        overflow-x: visible;
        background: none;
        box-shadow: none;
    }

    .stack-table {
        min-width: 0 !important;
        display: block;
    }

    .stack-table thead {
        display: none;
        /* Hide headers on mobile, we'll use labels */
    }

    .stack-table tbody,
    .stack-table tr,
    .stack-table td {
        display: block;
        width: 100%;
    }

    .stack-table tr {
        background: white;
        margin-bottom: 2rem;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .stack-table td {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(43, 138, 131, 0.05);
        position: relative;
    }

    .stack-table td:last-child {
        border-bottom: none;
    }

    /* Add labels using data-label attribute */
    .stack-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 900;
        color: var(--primary-color);
        font-size: 0.9rem;
        text-transform: uppercase;
        margin-bottom: 0.5rem;
        opacity: 0.8;
    }

    /* Specialized stacking for vertical comparison */
    .v-comparison-table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }

    .v-comparison-table td:first-child {
        grid-column: 1 / span 2;
        width: 100% !important;
        background: var(--primary-color) !important;
        color: white !important;
        text-align: right !important;
        padding: 0.5rem 1.5rem !important;
    }

    .v-comparison-table td:first-child::before {
        content: "الفئة: ";
        display: inline;
        color: rgba(255, 255, 255, 0.8);
    }
}

/* Process Flow (1 -> 2 -> 3) */
.process-flow {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.5rem;
    margin: 3rem 0;
}

@media (max-width: 768px) {
    .process-flow {
        flex-direction: column;
    }
}

.process-step {
    flex: 1;
    background: #e6fcf8;
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    position: relative;
    border: 1px solid rgba(43, 138, 131, 0.2);
    transition: transform 0.3s ease;
}

.process-step:hover {
    transform: translateY(-5px);
}

.process-step::after {
    content: '\2190';
    /* Left Arrow for RTL */
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.5;
    z-index: 10;
}

@media (max-width: 768px) {
    .process-step::after {
        left: 50%;
        top: auto;
        bottom: -2rem;
        transform: translateX(-50%) rotate(-90deg);
    }
}

.process-step:last-child::after {
    content: none;
}

.process-number {
    font-size: 4rem;
    font-weight: 900;
    color: rgba(43, 138, 131, 0.15);
    position: absolute;
    top: -10px;
    right: 20px;
    line-height: 1;
}

.process-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.process-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    position: relative;
    z-index: 2;
}

/* Structure Grid (Prompt Components) */
.structure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem 2rem;
    margin-top: 3rem;
}

.structure-card {
    background: white;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    transition: box-shadow 0.3s ease;
}

.structure-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.structure-number {
    position: absolute;
    top: -20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    font-weight: 800;
    font-family: monospace;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 4px 8px rgba(43, 138, 131, 0.4);
}

.structure-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 800;
}

.structure-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.structure-card ul li {
    position: relative;
    padding-right: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.structure-card ul li::before {
    content: '✓';
    color: #10b981;
    position: absolute;
    right: 0;
    font-weight: bold;
}

.structure-example {
    background: #f8fafc;
    border-right: 3px solid var(--neon-blue);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-color);
}

.structure-example span {
    font-weight: 700;
    color: var(--text-color);
    display: block;
    margin-bottom: 0.25rem;
}

/* Image Prompt Grid (1 to 10) */
.image-prompt-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 900px) {
    .image-prompt-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
        width: 100%;
    }

    .grid-2-desktop {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        width: 100%;
    }
}

.ip-step {
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    padding: 1.5rem 1.5rem 1.5rem 4.5rem;
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 4px solid #f1f5f9;
}

[dir="rtl"] .ip-step {
    padding: 1.5rem 4.5rem 1.5rem 1.5rem;
    border-right: 4px solid #f1f5f9;
}

.ip-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-right-color: var(--primary-color);
}

.ip-num {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    background: #f1f5f9;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

.ip-step:hover .ip-num {
    background: var(--primary-color);
    color: white;
}

.ip-step h4 {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

.ip-step:hover h4 {
    color: var(--primary-color);
}

.ip-step p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.ip-step p em {
    display: block;
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.85rem;
    font-style: normal;
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border-right: 2px solid var(--neon-blue);
}

/* Full Prompt Card */
.full-prompt-card {
    background: #f0fdf4;
    border-right: 4px solid #22c55e;
    padding: 1.25rem 2.25rem;
    /* Reduced top padding */
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.full-prompt-card>div {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text-color);
    font-size: 1.1rem;
}

.full-prompt-card>div:last-child {
    margin-bottom: 0;
}

.full-prompt-card>div strong {
    color: #166534;
    display: inline-block;
    margin-bottom: 0.25rem;
}

/* Image Prompt Showcase */
.image-prompt-showcase {
    display: flex;
    flex-direction: column;
    /* Stack on mobile */
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2.5rem;
}

@media (min-width: 992px) {
    .image-prompt-showcase {
        flex-direction: row;
        /* Horizontal on desktop */
    }
}

.ip-text {
    flex: 1.2;
    padding: 2rem 2.5rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    justify-content: flex-start;
    /* Start from top, not center */
}

.ip-image {
    flex: 1;
    /* Take equal space with text */
    background: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    border-left: 1px solid var(--border-color);
}

.ip-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.ip-image img:hover {
    transform: scale(1.03);
}

.ip-text-block {
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 1.5rem;
    background: #f0fdf4;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    width: 100%;
}

.prompt-details-inline {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.prompt-details-inline span {
    display: inline;
    background: rgba(0, 0, 0, 0.03);
    padding: 2px 6px;
    border-radius: 4px;
    margin: 2px;
}

.ip-highlight {
    color: var(--primary-color);
    font-weight: 900;
    background: rgba(43, 138, 131, 0.05);
    padding: 0 4px;
    border-radius: 4px;
}

.ip-text-block.english {
    font-family: inherit;
    direction: ltr;
    text-align: left;
}

/* Style Guide Components */
.style-intro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.style-badge {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.style-showcase-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 3rem;
}

.ss-header {
    background: #f8fafc;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.ss-header h3 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ss-body {
    padding: 2rem;
}

.ss-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .ss-features {
        grid-template-columns: 1fr;
    }
}

.ss-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ss-feature-list li {
    position: relative;
    padding-right: 1.6rem;
    margin-bottom: 0.85rem;
    color: var(--text-secondary);
    font-size: 1.25rem;
    line-height: 1.8;
}

.ss-feature-list li::before {
    content: '→';
    position: absolute;
    right: 0;
    color: var(--neon-blue);
    font-weight: bold;
}

.ss-gallery {
    display: flex;
    flex-direction: column;
    /* Force images to stack vertically */
    gap: 2rem;
    align-items: stretch;
}

/* Constrain huge image blocks on ultra-wide screens */
.ss-gallery,
.comp-image-area,
.summary-image-wrap {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

.ss-image-wrap {
    background: #ffffff !important;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    width: 100%;
    /* Take full available width */
    aspect-ratio: 3 / 2;
    /* Larger, more cinematic aspect ratio */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.ss-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    mix-blend-mode: multiply;
    /* Helps blend any residual white/beige edges with the container */
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Comparison Table Styles */
.comparison-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 3rem;
    box-shadow: var(--shadow-md);
}

.comp-header {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.comp-body {
    display: flex;
    flex-direction: column;
    /* Stack image and table vertically */
    gap: 0;
}

.comp-image-area {
    padding: 2.5rem;
    /* More space for a larger image */
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Removed border-bottom for cleaner look */
}

.comp-table-area {
    padding: 1.5rem;
}

.comp-table {
    width: 100%;
    border-collapse: collapse;
}

.comp-table th {
    background: #c05a5a;
    color: white;
    padding: 1rem;
    font-weight: 700;
    text-align: center;
}

.comp-table td {
    padding: 1rem;
    border: 1px solid #eee;
    text-align: center;
    font-size: 0.95rem;
}

.comp-table tr:nth-child(even) {
    background: #fcf4f4;
}

.comp-row-title {
    background: #eebbbb !important;
    font-weight: 700;
}

@media (max-width: 992px) {
    .image-prompt-showcase {
        flex-direction: column;
    }

    .ip-text {
        border-left: none;
        border-bottom: 1px solid var(--border-color);
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .comp-body {
        grid-template-columns: 1fr;
    }

    .comp-image-area {
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }
}

.ss-image-wrap:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.ss-image-wrap:hover img {
    transform: scale(1.03);
}

.ss-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(43, 138, 131, 0.06);
    color: var(--primary-color);
    border: 1px solid rgba(43, 138, 131, 0.15);
    /* Added subtle border */
    border-radius: 8px;
    font-size: 1.2rem;
    /* Matches the visual weight of Arabic text */
    margin-right: 0.5rem;
    font-weight: 700;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    /* High-end English fonts */
    letter-spacing: -0.01em;
}

/* ==================== 📱 Mobile Optimization (Phase 7) ==================== */
@media (max-width: 768px) {

    /* Reclaiming Screen Real Estate on Small Viewports */
    .ss-header,
    .ss-body,
    .comp-body {
        padding: 1.25rem !important;
    }

    .comp-image-area {
        padding: 1rem !important;
        margin-top: 1rem !important;
        /* Overriding inline 2rem margin */
    }

    .comp-header,
    .comp-table-area {
        padding: 1rem !important;
    }
}

/* ==================== 🛠️ UX Upgrades (Accordion, Progress, Lightbox, Copy) ==================== */

/* Copy Prompt Button */
.copy-prompt-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

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

.ip-text-block {
    position: relative;
    padding-top: 3rem;
    /* Make room for the button */
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

/* Image Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

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

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

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

/* Cursor pointer for gallery images */
.ss-image-wrap img,
.ip-image img {
    cursor: zoom-in;
}

/* Typograph readability improvements */
.slide-text,
.process-desc,
.app-card ul li {
    max-width: 850px;
}

.slide-text {
    color: #334155;
}

/* ==================== Layout Optimizations (Fix Huge Images) ==================== */
@media (min-width: 992px) {

    /* Auto-split layout: If a card has both features and an image, show them side-by-side */
    .style-showcase-card .ss-body:has(.ss-features):has(.comp-image-area) {
        display: grid;
        grid-template-columns: 1fr 1.2fr;
        gap: 3rem;
        align-items: center;
    }

    /* General rules for compact showcase images - Show FULL image */
    .comp-image-area img {
        max-height: 550px;
        object-fit: contain;
        width: auto;
        max-width: 100%;
        background: transparent;
        border-radius: var(--radius-md);
        display: block;
        margin: 0 auto;
        cursor: zoom-in;
        /* Show magnifying glass icon on hover */
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
    }

    .comp-image-area img:hover {
        transform: scale(1.02);
        /* Very subtle zoom effect */
        box-shadow: var(--shadow-lg);
        /* Add professional depth on hover */
    }

    .style-showcase-card .ss-features {
        margin-bottom: 0;
        grid-template-columns: 1fr;
        /* Stack features in 1 column in half layout */
        align-self: center;
        /* Align text block middle */
    }

    .style-showcase-card .ss-feature-list {
        columns: 1 !important;
        /* Prevent double columns when squeezed */
    }

    .style-showcase-card .ss-gallery,
    .style-showcase-card .comp-image-area {
        margin-top: 0 !important;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .style-showcase-card .ss-gallery {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* Put both images side by side! */
        gap: 1.5rem;
    }
}

/* ==================== Mobile Responsiveness Overrides ==================== */
@media (max-width: 768px) {

    /* Reduce global container padding */
    body.bg-light .container.py-xl {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .course-content-area {
        padding: 1.25rem 1rem !important;
        border-radius: 12px;
        padding-bottom: 5rem !important;
        /* Extra padding to clear floating buttons */
    }

    /* Fix info boxes and prompt examples from being too narrow */
    .info-box {
        padding: 1.25rem 1rem !important;
        margin: 1.5rem 0 !important;
    }

    .ip-text {
        padding: 1.25rem 1rem !important;
    }

    .ip-text-block {
        padding: 1rem !important;
        font-size: 1rem !important;
    }

    .ss-header,
    .ss-body {
        padding: 1.25rem 1rem !important;
    }

    /* Stack image-prompt-showcase on mobile */
    .image-prompt-showcase {
        flex-direction: column !important;
    }

    .ip-text,
    .ip-image {
        width: 100% !important;
        flex: none !important;
    }

    .ip-image {
        padding: 1rem !important;
        border-left: none !important;
        border-top: 1px solid var(--border-color);
    }

    /* Optimize slide title for small screens */
    .slide-title {
        font-size: 1.5rem !important;
        padding-right: 0 !important;
    }

    .course-chapter-header h1 {
        font-size: 1.8rem !important;
    }
}