/* Admin Panel Custom Theme */

:root {
    --admin-primary: #3E2723;
    /* Dark Chocolate */
    --admin-secondary: #2d2926;
    --admin-bg: #f3f4f6;
    --admin-card-bg: #ffffff;
    --admin-text: #1f2937;
    --admin-border: #e5e7eb;

    /* Alias for compatibility with existing Tailwind classes */
    --primary-color: var(--admin-primary);
}

/* Dashboard Container */
.admin-panel-content {
    background-color: var(--admin-bg);
    border-radius: 12px;
    /* Smooth corners */
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

/* Headers */
.admin-panel-content h2 {
    font-family: 'Roboto Condensed', sans-serif;
    color: var(--admin-secondary);
    border-bottom: 2px solid var(--admin-primary);
    padding-bottom: 12px;
    margin-bottom: 24px;
    font-size: 1.75rem;
    letter-spacing: 0.5px;
}

/* Cards */
.youtube-resource-card,
.course-card,
.category-card,
.subcategory-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--admin-border);
    background: var(--admin-card-bg);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    /* Default shadow */
    /* Ensure rounded corners */
}

.youtube-resource-card:hover,
.course-card:hover,
.category-card:hover,
.subcategory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--admin-primary);
}

/* Forms */
#add-youtube-form {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
}

#add-youtube-form label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-secondary);
    margin-bottom: 8px;
    display: block;
}

#add-youtube-form input[type="text"],
#add-youtube-form input[type="url"],
#add-youtube-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 0.95rem;
}

#add-youtube-form input:focus,
#add-youtube-form select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(139, 94, 77, 0.15);
    outline: none;
}

/* Buttons */
.engineering-btn {
    background: linear-gradient(135deg, #C9A55C 0%, #E2C17C 100%);
    color: #000;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.engineering-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

/* Stats / Counts - if applicable */
.resource-count-badge {
    background: var(--admin-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .admin-panel-content {
        padding: 16px;
        border-radius: 0;
        /* Full width on mobile */
    }

    .youtube-categories-container {
        grid-template-columns: 1fr;
    }
}

/* Bulk Action Toolbar */
#bulk-action-toolbar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background-color: white;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
    min-width: min(300px, 92vw);
    max-width: 95vw;
    justify-content: center;
    bottom: calc(2rem + var(--safe-area-bottom, 0px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 640px) {
    #bulk-action-toolbar {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        width: 92%;
        bottom: calc(1.5rem + var(--safe-area-bottom, 10px));
        flex-wrap: wrap;
    }

    #bulk-action-toolbar button span {
        display: none;
        /* Hide text on very small screens, keep icons */
    }

    #bulk-action-toolbar button i {
        margin: 0 !important;
    }

    .bulk-count-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
}

#bulk-action-toolbar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bulk-count-badge {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

/* Custom Checkbox for Cards */
.admin-card-checkbox {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 20;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show checkbox on hover or when checked */
.group:hover .admin-card-checkbox,
.admin-card-checkbox:checked {
    opacity: 1;
}

/* When checked, add a subtle border to the card to indicate selection */
.admin-card-selected {
    border-color: var(--primary-color) !important;
    background-color: rgba(62, 39, 35, 0.05) !important;
}

/* Mobile specific for checkboxes (always visible on touch) */
@media (hover: none) {
    .admin-card-checkbox {
        opacity: 1;
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* ============================================
   PROFESSIONAL COURSE DISPLAY STYLES
   ============================================ */

/* Course Card Grid */
.courses-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 8px 0;
    align-items: start;
    /* Each card has its own height, rows don't stretch together */
}

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

/* Professional Course Card */
.course-card-pro {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.course-card-pro:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    border-color: var(--admin-primary);
}

/* Thumbnail Wrapper */
.course-thumbnail-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.course-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card-pro:hover .course-thumbnail-wrapper img {
    transform: scale(1.08);
}

/* Gradient Overlay */
.course-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            transparent 0%,
            transparent 40%,
            rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.course-overlay-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--admin-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Course Info Section */
.course-info {
    padding: 24px;
}

.course-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Course Meta & CTA */
.course-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.course-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.course-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #888;
}

.course-stat-item i {
    font-size: 0.75rem;
    color: var(--admin-primary);
}

.course-cta {
    color: var(--admin-primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.course-card-pro:hover .course-cta {
    gap: 12px;
}

.course-cta i {
    transition: transform 0.3s ease;
}

.course-card-pro:hover .course-cta i {
    transform: translateX(4px);
}

/* Category Cards (Main Categories) */
.category-card-pro {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.category-card-pro:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--admin-primary);
}

.category-thumbnail-wrapper {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, #2d2926 0%, #3E2723 100%);
}

.category-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: all 0.5s ease;
}

.category-card-pro:hover .category-thumbnail-wrapper img {
    transform: scale(1.05);
    opacity: 1;
}

.category-icon-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3E2723 0%, #5D4037 100%);
}

.category-icon-placeholder i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
}

.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(0, 0, 0, 0.5) 100%);
}

.category-info {
    padding: 20px;
}

.category-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.35;
}

.category-description {
    font-size: 0.85rem;
    color: #777;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Subcategory Cards */
.subcategory-card-pro {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.subcategory-card-pro:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--admin-primary);
}

.subcategory-thumbnail-wrapper {
    position: relative;
    height: 120px;
    overflow: hidden;
    background: linear-gradient(135deg, #4a3f3a 0%, #3E2723 100%);
}

.subcategory-info {
    padding: 16px;
}

.subcategory-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

/* Content Cards (Books, Exams, Videos) */
.content-card-pro {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.content-card-pro:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--admin-primary);
}

.content-thumbnail-wrapper {
    position: relative;
    height: 140px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-thumbnail-wrapper.book-thumb {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
}

.content-thumbnail-wrapper.exam-thumb {
    background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
}

.content-thumbnail-wrapper.video-thumb {
    background: linear-gradient(135deg, #C62828 0%, #B71C1C 100%);
}

.content-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-icon-placeholder {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.4);
}

.content-info {
    padding: 16px;
}

.content-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-meta {
    font-size: 0.8rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.content-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--admin-primary);
    transition: gap 0.3s ease;
}

.content-card-pro:hover .content-cta {
    gap: 10px;
}

/* NEW Badge Styling */
.new-badge-pro {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Loading Skeleton */
.skeleton-card {
    border-radius: 16px;
    background: #f5f5f5;
    overflow: hidden;
}

.skeleton-thumbnail {
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin: 12px 16px;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Section Headers */
.section-header-pro {
    margin-bottom: 32px;
}

.section-header-pro h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header-pro p {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
}

/* Breadcrumb Navigation Enhanced */
.breadcrumb-nav-pro {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f8f8;
    border-radius: 12px;
    flex-wrap: wrap;
}

.breadcrumb-nav-pro i {
    color: var(--admin-primary);
}

.breadcrumb-item-pro {
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.breadcrumb-item-pro:hover {
    color: var(--admin-primary);
    text-decoration: underline;
}

.breadcrumb-item-pro.active {
    color: #1a1a1a;
    font-weight: 600;
    cursor: default;
}

.breadcrumb-item-pro.active:hover {
    text-decoration: none;
}

.breadcrumb-separator-pro {
    color: #ccc;
    font-size: 0.8rem;
}

/* Back Button */
.back-btn-pro {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    color: #444;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn-pro:hover {
    background: var(--admin-primary);
    color: white;
    border-color: var(--admin-primary);
}

/* Tabs Enhanced */
.content-tabs-pro {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 24px;
}

.content-tab-pro {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.content-tab-pro:hover {
    color: #333;
}

.content-tab-pro.active {
    background: white;
    color: var(--admin-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Empty State */
.empty-state-pro {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-pro i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state-pro h3 {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 8px;
}

.empty-state-pro p {
    color: #999;
    font-size: 0.95rem;
}

/* ============================================
   SIMPLE CARD STYLES (No Thumbnails)
   ============================================ */

/* Simple Card Base */
.simple-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: visible;
    /* Allow expanded content to show */
    min-height: auto;
    display: flex;
    flex-direction: column;
}

.simple-card:hover {
    border-color: var(--admin-primary, #3e2723);
    box-shadow: 0 4px 12px rgba(62, 39, 35, 0.1);
    transform: translateY(-2px);
}

.simple-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    flex: 0 0 auto;
}

/* Expanded content inside simple-card - full width below card content */
.simple-card .course-expanded-content {
    width: 100%;
    border-radius: 0 0 12px 12px;
}

.simple-card-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-radius: 12px;
    color: var(--admin-primary, #3e2723);
    font-size: 1.25rem;
}

/* .simple-card-icon.video-icon removed to match other icons style (chocolate) */

.simple-card-info {
    flex: 1;
    min-width: 0;
}

.simple-card-info .category-title,
.simple-card-info .subcategory-title,
.simple-card-info .content-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.3;
}

.simple-card-info .category-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.simple-card-info .category-meta,
.simple-card-info .content-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.simple-card-info .course-stat-item,
.simple-card-info .content-meta span {
    font-size: 0.8rem;
    color: #888;
}

.simple-card-info .course-stat-item i,
.simple-card-info .content-meta i {
    margin-right: 4px;
}

.simple-card-info .course-cta,
.simple-card-info .content-cta {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--admin-primary, #3e2723);
}

.simple-card:hover .course-cta,
.simple-card:hover .content-cta {
    color: #5d4037;
}

/* Override padding for simple cards */
.category-card-pro.simple-card,
.subcategory-card-pro.simple-card,
.content-card-pro.simple-card {
    padding: 0;
}

/* Mobile adjustments for simple cards */
@media (max-width: 640px) {
    .simple-card-content {
        padding: 16px;
        gap: 12px;
    }

    .simple-card-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1rem;
    }

    .simple-card-info .category-title,
    .simple-card-info .subcategory-title,
    .simple-card-info .content-title {
        font-size: 0.95rem;
    }
}

/* ============================================
   MINIMALIST NOTIFICATION BADGES
   ============================================ */

/* Count badge for courses/categories/subcategories - notification style */
.new-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Dot indicator for individual content items */
.new-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 2px white, 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Tab badge for content tabs */
.tab-new-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 9px;
    vertical-align: middle;
}

/* Ensure cards with badges have relative positioning */
.course-card-pro,
.category-card-pro,
.subcategory-card-pro,
.content-card-pro {
    position: relative;
}

/* Hide old badge style */
.new-badge-pro {
    display: none;
}

/* ============================================
   ADMIN PANEL COURSE GRID STYLES
   ============================================ */

/* Admin course grid layout */
.admin-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Expanded content styling - full width below card */
.course-expanded-content {
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 16px 16px;
}

/* Main categories grid inside expanded content */
.course-expanded-content .courses-grid-pro {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Ensure course card in admin has relative positioning for drag handle */
/* Sortable handle for all card types */
.course-card-pro .sortable-handle,
.category-card-pro .sortable-handle,
.subcategory-card-pro .sortable-handle {
    position: absolute;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.course-card-pro:hover .sortable-handle,
.category-card-pro:hover .sortable-handle,
.subcategory-card-pro:hover .sortable-handle {
    opacity: 1;
}

/* Sortable ghost styling */
.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-color) !important;
}

/* Sortable drag styling - prevent distortion */
.sortable-drag {
    opacity: 1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
}

/* Ensure cards have proper positioning */
.course-card-pro,
.category-card-pro,
.subcategory-card-pro {
    position: relative;
}

/* ============================================
   Header & Section Alignment on Tablet/Desktop
   Aligns logo and section headers with course grid content
   Moved from app-theme.css to ensure it applies in Light Mode
   ============================================ */
@media (min-width: 768px) {

    /* Header inner container - align logo with max-w-7xl content */
    header>.px-4,
    header>div.px-4,
    header .flex.items-center.justify-between {
        max-width: 1280px !important;
        /* matches max-w-7xl */
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    /* Section headers in courses - align with grid */
    .section-header-pro,
    .breadcrumb-nav-pro {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Engineering card container alignment - match header 1280px */
    .engineering-card.max-w-7xl,
    .engineering-card.p-6,
    .engineering-card,
    #courses-section .engineering-card,
    #courses-section>.engineering-card {
        max-width: 1280px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}

/* Desktop alignment - adjust for wider screens */
@media (min-width: 1024px) {

    header>.px-4,
    header>div.px-4,
    header .flex.items-center.justify-between {
        padding-left: 32px !important;
        padding-right: 32px !important;
    }

    .engineering-card.max-w-7xl,
    .engineering-card.p-6,
    .engineering-card,
    #courses-section .engineering-card,
    #courses-section>.engineering-card {
        max-width: 1280px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 32px !important;
        padding-right: 32px !important;
    }
}

/* ============================================
   Force Courses Section Alignment (Light & Dark Mode)
   ============================================ */
#courses-section .engineering-card,
#courses-section>.engineering-card,
#courses .engineering-card {
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (min-width: 768px) {

    #courses-section .engineering-card,
    #courses-section>.engineering-card,
    #courses .engineering-card {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}

@media (min-width: 1024px) {

    #courses-section .engineering-card,
    #courses-section>.engineering-card,
    #courses .engineering-card {
        padding-left: 32px !important;
        padding-right: 32px !important;
    }
}

/* ============================================
   Engineering Card - Base Styles for Layout Consistency
   ============================================ */
.engineering-card {
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    /* Ensure no extra spacing from borders/shadows affects position */
}

/* ============================================
   Courses Section - Vertical Positioning Fix
   ============================================ */
/* --- LAYOUT STABILITY FIXES --- */

/* 
   Refined Strategy: 
   1. Remove all spacing from the bottom of #dashboard relative to the next section.
   2. Enforce the gap strictly on the top of #courses.
   3. Use high-specificity selectors (html body ...) to guarantee override of generic theme styles.
*/

html body #dashboard {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    /* Remove any previous padding/margin attempts to let nature take its course */
}

html body #courses {
    /* Own the gap. Reduced to 12px (approx 0.5 inches visually relative to text). */
    margin-top: 12px !important;
    padding-top: 0 !important;
}

/* Ensure the inner container matches Dark Mode's 8px padding */
html body #courses-section,
html body .courses-section-container {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

/* Stabilize the user content wrapper */
.user-content {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Include full container reset just in case */
/* Ensure container has correct horizontal spacing too */
.courses-section-container {
    padding-left: 96px !important;
    padding-right: 96px !important;
    width: 100% !important;
    max-width: none !important;
}

@media (max-width: 1024px) {
    .courses-section-container {
        padding-left: 48px !important;
        padding-right: 48px !important;
    }
}

@media (max-width: 640px) {
    .courses-section-container {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}

/* ============================================
   Section Header Styling (Light & Dark Mode Consistency)
   ============================================ */
:root {
    --gold: #C9A55C;
    /* Ensure gold is available in Light Mode */
    --text-secondary: #666666;
    /* Default for Light Mode - Dark Gray for visibility */
}

.section-header-pro {
    text-align: left;
    margin-bottom: 32px;
}

.section-header-pro h2 {
    color: var(--gold) !important;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-header-pro p {
    color: var(--text-secondary) !important;
    font-size: 1rem;
}