/* ================================
   TECH WITH TKS - Flat Design System (Enhanced)
   Consistent Layout for All Lists
   ================================ */

/* ===== 1. CONTAINER STYLE (FLAT DESIGN) ===== */
.list-container {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    transition: border-color 0.2s ease, background 0.2s ease;
    box-shadow: none;
}

.list-container:hover {
    background: var(--bg-surface, #f9fafb);
    border-color: var(--border-strong, #d1d5db);
    transform: none;
    box-shadow: none;
}

/* ===== 2. GRID LAYOUT & RESPONSIVENESS ===== */

/* Desktop: 3 items per row, 20 items per page */
.items-grid,
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    /* slightly larger gap */
    margin-bottom: 48px;
}

/* Tablet: 2 items per row, 15 items per page */
@media (max-width: 1024px) and (min-width: 768px) {

    .items-grid,
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Mobile: 1 item per row, 10 items per page */
@media (max-width: 767px) {

    .items-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ===== PHASE B — CUSTOM ASYMMETRIC CONTAINER ===== */
.custom-container {
    background: var(--bg-card, #ffffff);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .custom-container {
    background: var(--card-bg-dark, #111827);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* ===== 3. ITEM CARD (FLAT DESIGN, REFINED) ===== */
.item-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    position: relative;
}

[data-theme="dark"] .item-card {
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* ---- Card image wrapper — images do not touch card edges ---- */
.card-image-wrapper {
    border-radius: 14px;
    overflow: hidden;
    margin: 16px 16px 0 16px;
}

/* Image Section — static, no hover overlay */
.item-card .card-image,
.item-card .project-image {
    position: relative;
    height: 200px;
    background: var(--bg-surface, #f9fafb);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
}

.item-card .tutorial-thumbnail,
.item-card .project-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.item-card .card-icon,
.item-card .project-icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7B77EB;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(123, 119, 235, 0.08) 0%, rgba(91, 95, 239, 0.08) 100%);
}

.item-card .card-icon svg,
.item-card .project-icon-fallback svg {
    opacity: 0.65;
}

.item-card .card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 12px;
    background: var(--primary, #2563EB);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    z-index: 3;
    transition: background 0.2s ease;
}

/* Difficulty badge — sits left of category badge */
.card-difficulty-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 6px;
    z-index: 3;
}

.card-difficulty-badge.beginner {
    background: #D1FAE5;
    color: #065F46;
}

.card-difficulty-badge.intermediate {
    background: #FEF3C7;
    color: #92400E;
}

.card-difficulty-badge.advanced {
    background: #FEE2E2;
    color: #991B1B;
}

[data-theme="dark"] .card-difficulty-badge.beginner {
    background: rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
}

[data-theme="dark"] .card-difficulty-badge.intermediate {
    background: rgba(245, 158, 11, 0.2);
    color: #FCD34D;
}

[data-theme="dark"] .card-difficulty-badge.advanced {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

.item-card .badge-popular {
    background: #22C55E;
}

.item-card:hover .badge-popular {
    background: #1cb44e;
}

/* Content Section */
.item-card .card-content,
.item-card .project-content {
    padding: 22px 20px 20px 20px;
    /* refined spacing */
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-card-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 10px;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.item-card-title a {
    color: var(--text-primary, #111827);
    text-decoration: none;
    transition: color 0.2s ease;
}

.item-card-title a:hover {
    color: var(--primary, #2563EB);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.item-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}

.item-card-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.item-card-meta-item:hover {
    color: var(--text-secondary, #4b5563);
}

.item-card-description {
    font-size: 14px;
    color: var(--text-secondary, #4b5563);
    line-height: 1.6;
    margin-bottom: 18px;
    flex: 1;
    /* Limit to 2 lines with ellipsis — cross-browser */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.item-card-footer {
    margin-top: auto;
}

/* ---- Card link / action text link (used on search results) ---- */
.card-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary, #2563EB);
    text-decoration: none;
    transition: color 0.2s ease, gap 0.2s ease;
    padding-top: 4px;
}

.card-action-btn:hover {
    color: var(--primary-hover, #1D4ED8);
    gap: 10px;
}

.card-action-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.card-action-btn:hover svg {
    transform: translateX(3px);
}

/* ===== 4. PARALLELOGRAM BUTTONS (GLOBAL, refined animation) ===== */
/* btn-parallelogram is now a flat pill — override flat-design to match main.css */
.btn-parallelogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    background: var(--primary, #2563EB);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-primary, 'Inter', sans-serif);
    text-decoration: none;
    border: none;
    cursor: pointer;
    border-radius: 999px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-parallelogram span {
    display: inline-block;
    transform: none;
}

.btn-parallelogram:hover {
    background: var(--primary-hover, #1D4ED8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-parallelogram:active {
    transform: translateY(0);
}

/* Small button modifier */
.btn-parallelogram.btn-small,
.btn-small {
    height: 36px;
    padding: 0 18px;
    font-size: 13px;
}

/* Secondary / outline variant on btn-parallelogram */
.btn-parallelogram.btn-secondary {
    background: transparent;
    color: var(--primary, #2563EB);
    border: 1.5px solid var(--primary, #2563EB);
}

.btn-parallelogram.btn-secondary:hover {
    background: var(--primary, #2563EB);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}


.btn-parallelogram-secondary {
    background: var(--success, #16A34A);
}

.btn-parallelogram-secondary:hover {
    background: #15803D;
}

.btn-parallelogram-outline {
    background: transparent;
    border: 1.5px solid var(--primary, #2563EB);
    color: var(--primary, #2563EB);
}

.btn-parallelogram-outline:hover {
    background: var(--primary, #2563EB);
    color: #ffffff;
}

/* ===== 5. PAGINATION BAR (MANDATORY, enhanced) ===== */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
    padding: 24px 0 16px;
    border-top: 1px solid var(--border, #e5e7eb);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e5e7eb);
    color: var(--text-secondary, #4b5563);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.pagination-btn span {
    display: inline-block;
    transform: none;
}

.pagination-btn:hover {
    background: var(--bg-surface, #f9fafb);
    border-color: var(--primary, #2563EB);
    color: var(--primary, #2563EB);
}

.pagination-btn.active {
    background: var(--primary, #2563EB);
    border-color: var(--primary, #2563EB);
    color: #ffffff;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-secondary);
}

/* Pagination arrows */
.pagination-arrow {
    font-size: 16px;
}

/* ===== 6. TECH STACK TAGS (PROJECTS) ===== */
.tech-stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tech-tag {
    padding: 4px 12px;
    background: var(--bg-surface, #f3f4f6);
    color: var(--text-secondary, #4b5563);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border, #e5e7eb);
    transition: background 0.15s ease, color 0.15s ease;
}

.tech-tag:hover {
    background: var(--border, #e5e7eb);
    color: var(--text-primary, #1f2937);
}

/* ===== 7. PARTNER LOGO (PARTNERS PAGE) ===== */
.partner-logo-container {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface, #f9fafb);
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border, #e5e7eb);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.partner-logo-container:hover {
    border-color: var(--border-strong, #d1d5db);
    background: var(--bg-card, #ffffff);
}

.partner-logo {
    max-width: 80%;
    max-height: 80px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.partner-logo-container:hover .partner-logo {
    transform: scale(1.02);
}

.partner-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin-bottom: 8px;
    text-align: center;
}

/* ===== 8. CATEGORY BADGE ===== */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #ede9fe;
    color: #7B77EB;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.category-badge:hover {
    background: #e0d7fc;
    color: #5B5FEF;
}

/* ===== 9. RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 767px) {
    .list-container {
        padding: 20px;
        margin-bottom: 20px;
    }

    .item-card {
        padding: 0;
        /* card handles padding internally */
    }

    .item-card-title {
        font-size: 16px;
    }

    .item-card-description {
        font-size: 13px;
    }

    .btn-parallelogram {
        padding: 8px 20px;
        font-size: 13px;
    }

    .pagination-bar {
        gap: 6px;
        margin-top: 36px;
    }

    .pagination-btn {
        min-width: 38px;
        height: 38px;
        padding: 0 10px;
        font-size: 13px;
    }

    .partner-logo-container {
        height: 100px;
    }
}

/* ===== 10. FEATURED SECTION (HOMEPAGE) ===== */
.featured-section {
    margin-bottom: 64px;
}

.featured-section .section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin-bottom: 28px;
    position: relative;
    display: inline-block;
}

.featured-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #7B77EB;
    border-radius: 2px;
    opacity: 0.5;
}

.featured-section .items-grid {
    margin-bottom: 28px;
}

/* ===== 11. PAGE HEADER ===== */
.page-header-flat {
    margin-bottom: 48px;
    text-align: center;
}

.page-header-flat h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin-bottom: 12px;
    animation: fadeInDown 0.4s ease-out;
}

.page-header-flat p {
    font-size: 16px;
    color: var(--text-muted, #6b7280);
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .page-header-flat h1 {
        font-size: 28px;
    }

    .page-header-flat p {
        font-size: 14px;
    }

    .featured-section .section-title {
        font-size: 24px;
    }
}

/* ===== 12. RESULTS INFO ===== */
.results-info-flat {
    margin-bottom: 28px;
    padding: 12px 20px;
    background: var(--bg-surface, #f9fafb);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-muted, #6b7280);
    text-align: center;
    border: 1px solid var(--border, #e5e7eb);
}

/* ===== 13. NO HOVER OVERRIDES (ensuring flatness, but we have subtle animations) ===== */
* {
    backface-visibility: visible;
    perspective: none;
}

.item-card,
.list-container,
.btn-parallelogram,
.pagination-btn {
    will-change: auto;
}

/* ===== 14. DIFFICULTY BADGE (FLAT VERSION) ===== */
.difficulty-badge-flat {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    transition: filter 0.2s ease;
}

.difficulty-badge-flat.beginner {
    background: #d1fae5;
    color: #065f46;
}

.difficulty-badge-flat.intermediate {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-badge-flat.advanced {
    background: #fee2e2;
    color: #991b1b;
}

.difficulty-badge-flat:hover {
    filter: brightness(0.97);
}

/* ===== 15. STATS DISPLAY (FLAT) ===== */
.item-stats-flat {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border, #e5e7eb);
}

.stat-item-flat {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12px !important;
    color: var(--text-muted, #6b7280) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: color 0.2s ease;
}

.stat-item-flat:hover {
    color: var(--text-secondary, #4b5563) !important;
}

.stat-item-flat svg {
    width: 16px;
    height: 16px;
    transition: stroke 0.2s ease;
}

.stat-item-flat:hover svg {
    stroke: #7B77EB;
}

/* ===== 16. INLINE SEARCH BAR ===== */
.search-form-inline {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    background: var(--bg-card, #ffffff);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.search-input-inline {
    flex: 1;
    padding: 14px 22px;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary, #1f2937);
    background: transparent;
}

.search-input-inline::placeholder {
    color: var(--text-disabled, #9ca3af);
}

.search-btn-inline {
    position: relative;
    padding: 14px 30px;
    background: #7B77EB;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.1s ease;
    clip-path: polygon(15px 0, 100% 0, 100% 100%, 0 100%);
    margin-left: -15px;
}

.search-btn-inline span {
    position: relative;
    z-index: 1;
}

.search-btn-inline:hover {
    background: var(--primary-hover, #1D4ED8);
}

.search-btn-inline:active {
    background: #4B4FDF;
    transform: translateX(0);
}

/* Mobile responsive */
@media (max-width: 767px) {
    .search-input-inline {
        padding: 12px 16px;
        font-size: 14px;
    }

    .search-btn-inline {
        padding: 12px 22px;
        font-size: 14px;
        clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%);
        margin-left: -10px;
    }
}

/* ===== 17. MODERN DROPDOWN FILTER ===== */
.filter-container {
    margin-bottom: 28px;
}

.filter-dropdown {
    position: relative;
    max-width: 340px;
}

.filter-dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-dropdown-trigger:hover {
    border-color: var(--primary, #7B77EB);
    box-shadow: 0 2px 6px rgba(123, 119, 235, 0.08);
}

.filter-dropdown-trigger:focus {
    outline: none;
    border-color: var(--primary, #7B77EB);
    box-shadow: 0 0 0 3px var(--focus-ring, rgba(123, 119, 235, 0.15));
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

.filter-selected {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
    display: block;
}

.filter-arrow {
    flex-shrink: 0;
    margin-left: 12px;
    color: var(--text-disabled, #9ca3af);
    transition: transform 0.3s ease;
}

.filter-dropdown.active .filter-arrow {
    transform: rotate(180deg);
}

.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    box-shadow: var(--shadow-soft, 0 8px 20px rgba(0, 0, 0, 0.08));
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.25s ease;
    z-index: 100;
    max-height: 0;
    overflow: hidden;
}

.filter-dropdown.active .filter-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: 420px;
    overflow-y: auto;
}

.filter-dropdown-content {
    padding: 10px;
    max-height: 340px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
    user-select: none;
}

.filter-option:hover {
    background: var(--bg-surface, #f5f7ff);
}

.filter-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    margin-right: 14px;
    cursor: pointer;
    accent-color: var(--primary, #7B77EB);
    flex-shrink: 0;
}

.filter-option-text {
    font-size: 14px;
    color: var(--text-secondary, #374151);
    font-weight: 500;
    transition: color 0.2s ease;
}

.filter-checkbox:checked+.filter-option-text {
    color: var(--primary, #7B77EB);
    font-weight: 600;
}

/* Scrollbar styling */
.filter-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown-content::-webkit-scrollbar-track {
    background: var(--bg-surface, #f9fafb);
    border-radius: 4px;
}

.filter-dropdown-content::-webkit-scrollbar-thumb {
    background: var(--border-strong, #d1d5db);
    border-radius: 4px;
}

.filter-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #9ca3af);
}

/* Mobile responsive */
@media (max-width: 767px) {
    .filter-dropdown {
        max-width: 100%;
    }

    .filter-dropdown-trigger {
        padding: 10px 14px;
    }

    .filter-label {
        font-size: 11px;
    }

    .filter-selected {
        font-size: 13px;
    }
}

/* ===== 18. FILTER AND RESULTS ROW ===== */
.filter-results-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}

.filter-results-row .filter-dropdown {
    max-width: 340px;
    flex-shrink: 0;
}

.filter-results-row .results-info {
    margin-bottom: 0;
    text-align: right;
}

.filter-results-row .results-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted, #6b7280);
    font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .filter-results-row {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .filter-results-row .filter-dropdown {
        max-width: 100%;
    }

    .filter-results-row .results-info {
        text-align: left;
    }
}

/* ===== 19. CATEGORY BADGE ON IMAGE ===== */
.badge-category {
    background: rgba(123, 119, 235, 0.12) !important;
    color: var(--primary, #7B77EB) !important;
    font-weight: 600;
}

/* ===== 20. CARD FOOTER WITH ACTIONS ===== */
.item-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--bg-surface, #f3f4f6);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    color: var(--text-muted, #6b7280);
}

.action-btn:hover {
    background: var(--primary, #7B77EB);
    border-color: var(--primary, #7B77EB);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(123, 119, 235, 0.2);
}

.action-btn:hover svg {
    stroke: #ffffff;
}

.action-btn svg {
    stroke: var(--text-muted, #6b7280);
    transition: stroke 0.2s ease, transform 0.1s ease;
}

.action-btn:active {
    transform: scale(0.95) translateY(0);
}

/* Stats with border */
.item-stats-flat {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    padding-top: 14px;
    padding-bottom: 12px;
    border-top: 1px solid var(--border, #e5e7eb);
    border-bottom: 1px solid var(--border, #e5e7eb);
}

/* Mobile responsive */
@media (max-width: 767px) {
    .item-card-footer {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .item-card-footer .btn-parallelogram {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1 1 auto;
        min-width: 90px;
    }

    .item-card-footer .btn-parallelogram span {
        font-size: 12px;
        white-space: nowrap;
    }

    .item-actions {
        flex-shrink: 0;
        gap: 6px;
    }

    .action-btn {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .action-btn svg {
        width: 17px;
        height: 17px;
    }
}


/* ===== 21. AUTHOR/PUBLISHER DISPLAY ===== */
.stat-author {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border, #e5e7eb);
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.author-avatar-fallback {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7B77EB 0%, #5B5FEF 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid var(--border, #e5e7eb);
    transition: border-color 0.2s ease;
}

.author-name {
    font-size: 12px;
    color: var(--text-secondary, #4b5563);
    font-weight: 600;
    white-space: nowrap;
}

.stat-author:hover .author-name {
    color: var(--text-primary, #1f2937);
}

.stat-author:hover .author-avatar,
.stat-author:hover .author-avatar-fallback {
    border-color: #7B77EB;
}

/* Mobile responsive */
@media (max-width: 767px) {

    .author-avatar,
    .author-avatar-fallback {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        border: 2px solid var(--border, #e5e7eb);
    }

    .author-name {
        font-size: 12px;
        color: var(--text-secondary, #4b5563);
        font-weight: 600;
        white-space: nowrap;
    }
}

/* ===== 22. TUTORIAL IMAGE OVERLAY (MATCHING PROJECT STYLE) ===== */
.tutorial-overlay {
    position: absolute;
    inset: 0;
    background: rgba(123, 119, 235, 0.85);
    /* slightly more vibrant overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(2px);
}

.item-card:hover .tutorial-overlay {
    opacity: 1;
}

.tutorial-overlay .btn {
    background: #ffffff;
    color: #1f2937;
    padding: 10px 26px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    transform: translateY(5px);
    transition: transform 0.3s ease, background 0.2s ease, color 0.2s ease;
}

.item-card:hover .tutorial-overlay .btn {
    transform: translateY(0);
}

.tutorial-overlay .btn:hover {
    background: #7B77EB;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== 23. RESPONSIVE IMAGE STYLES (MOBILE & TABLET) ===== */

/* Tablet responsive */
@media (max-width: 1024px) and (min-width: 768px) {

    .item-card .card-image,
    .item-card .project-image {
        height: 180px;
    }

    .item-card .card-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
}

/* Mobile responsive */
@media (max-width: 767px) {

    .item-card .card-image,
    .item-card .project-image {
        height: 160px;
    }

    .item-card .card-badge {
        font-size: 9px;
        padding: 4px 9px;
    }

    .tutorial-overlay .btn,
    .project-overlay .btn {
        padding: 8px 20px;
        font-size: 13px;
    }

    .item-card .card-icon svg,
    .item-card .project-icon-fallback svg {
        width: 36px;
        height: 36px;
    }
}

/* ===== 24. ADDITIONAL MICRO-INTERACTIONS ===== */
.item-card .card-content {
    transition: background 0.2s ease;
}

.item-card:hover .card-content {
    background: var(--bg-card);
}

/* small bounce for pagination active */
.pagination-btn.active {
    transform: scale(1.05);
}

/* ===== 25. DARK MODE OVERRIDES (flat-design specific) ===== */
[data-theme="dark"] .difficulty-badge-flat.beginner {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

[data-theme="dark"] .difficulty-badge-flat.intermediate {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .difficulty-badge-flat.advanced {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

[data-theme="dark"] .category-badge {
    background: rgba(123, 119, 235, 0.2);
}

[data-theme="dark"] .badge-category {
    background: rgba(123, 119, 235, 0.2) !important;
}