/* =====================================================
   ObfuscatorJS Framework v3.2
   card.css
   Global Card System
   COMPACT TOOL CARD PRODUCTION VERSION

   Compatible with:
   - js/tools.js v3.0+
   - Full tool-card navigation
   - Existing tools.json
   - Existing category system
   - Existing card system

   DESIGN:
   - Clean
   - Compact
   - Professional
   - SEO-friendly visual hierarchy
   - Icon
   - Tool name
   - Category
   - Small arrow
   - No description on compact tool cards
   - Entire card clickable
===================================================== */


/* =====================================================
   BASE CARD
===================================================== */

.card {

    display: flex;

    flex-direction: column;

    min-width: 0;

    background: var(--surface-color);

    border: 1px solid var(--border-color);

    border-radius: var(--radius-lg);

    overflow: hidden;

    box-shadow: var(--shadow-sm);

    transition:
        transform .22s ease,
        box-shadow .22s ease,
        border-color .22s ease,
        background-color .22s ease;

}


/* =====================================================
   CARD HOVER
===================================================== */

.card:hover {

    transform: translateY(-2px);

    box-shadow: var(--shadow-md);

}


/* =====================================================
   CARD HEADER
===================================================== */

.card-header {

    padding: 20px 24px;

    border-bottom: 1px solid var(--border-color);

    background: var(--surface-color);

}


.card-header h2,
.card-header h3,
.card-header h4 {

    margin: 0;

    color: var(--text-color);

    line-height: 1.3;

}


/* =====================================================
   CARD BODY
===================================================== */

.card-body {

    flex: 1;

    padding: 24px;

}


.card-body p:last-child {

    margin-bottom: 0;

}


/* =====================================================
   CARD FOOTER
===================================================== */

.card-footer {

    padding: 18px 24px;

    border-top: 1px solid var(--border-color);

    background: var(--surface-color-2);

}


/* =====================================================
   TOOL CARD
   COMPACT VERSION
===================================================== */

.tool-card {

    position: relative;

    display: flex;

    flex-direction: row;

    align-items: center;

    width: 100%;

    min-width: 0;

    min-height: 86px;

    height: 100%;

    padding: 16px 18px;

    gap: 14px;

    background: var(--surface-color);

    border: 1px solid var(--border-color);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);

    overflow: hidden;

    cursor: pointer;

    transition:
        transform .22s ease,
        box-shadow .22s ease,
        border-color .22s ease,
        background-color .22s ease;

}


/* =====================================================
   TOOL CARD HOVER
===================================================== */

.tool-card:hover {

    transform: translateY(-2px);

    box-shadow: var(--shadow-md);

    border-color: var(--primary-light-color);

}


/* =====================================================
   TOOL CARD FOCUS
===================================================== */

.tool-card:focus {

    outline: none;

}


.tool-card:focus-visible {

    outline: var(--focus-width) solid var(--primary-color);

    outline-offset: var(--focus-offset);

    box-shadow: var(--shadow-sm);

}


/* =====================================================
   TOOL CARD ICON
===================================================== */

.tool-card__icon {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    flex: 0 0 auto;

    width: 44px;

    height: 44px;

    margin: 0;

    border-radius: var(--radius-md);

    background: var(--primary-light-color);

    color: var(--primary-color);

    font-size: 24px;

    line-height: 1;

    transition:
        transform .22s ease,
        background-color .22s ease,
        color .22s ease;

}


.tool-card__icon .material-symbols-outlined,
.tool-card__icon .material-icons {

    font-size: 24px;

    line-height: 1;

}


/* =====================================================
   TOOL CARD ICON HOVER
===================================================== */

.tool-card:hover .tool-card__icon {

    transform: scale(1.04);

    background: var(--primary-light-color);

    color: var(--primary-color);

}


/* =====================================================
   TOOL CARD CONTENT
===================================================== */

.tool-card__content {

    display: flex;

    flex-direction: column;

    justify-content: center;

    flex: 1;

    min-width: 0;

    gap: 5px;

    padding-right: 28px;

}


/* =====================================================
   TOOL CARD CATEGORY
===================================================== */

.tool-card__category {

    display: inline-flex;

    align-items: center;

    width: fit-content;

    max-width: 100%;

    padding: 2px 8px;

    border-radius: var(--radius-round);

    background: var(--primary-light-color);

    color: var(--primary-hover);

    font-size: var(--font-size-xs);

    font-weight: var(--font-semibold);

    line-height: 1.35;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}


/* =====================================================
   TOOL CARD TITLE
===================================================== */

.tool-card-title,
.tool-card__title {

    display: block;

    margin: 0;

    padding: 0;

    color: var(--text-color);

    /*
     * Use the existing framework variable.
     * --font-size-base is intentionally avoided.
     */

    font-size: var(--font-size-md);

    font-weight: var(--font-bold);

    line-height: 1.35;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    transition: color .22s ease;

}


.tool-card:hover .tool-card-title,
.tool-card:hover .tool-card__title {

    color: var(--primary-color);

}


/* =====================================================
   TOOL CARD DESCRIPTION
   HIDDEN IN COMPACT VERSION

   tools.js may still generate descriptions.
   They remain available in the DOM but are visually
   hidden for the compact card layout.

   Therefore:
   - No tools.js change required
   - Existing tools.json remains compatible
===================================================== */

.tool-card-description,
.tool-card__description {

    display: none !important;

}


/* =====================================================
   TOOL CARD COUNT
===================================================== */

.tool-card__count {

    display: none;

}


/* =====================================================
   TOOL CARD ARROW
===================================================== */

.tool-card__arrow {

    position: absolute;

    top: 50%;

    right: 14px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: 28px;

    height: 28px;

    margin: 0;

    color: var(--text-muted-color);

    opacity: .65;

    pointer-events: none;

    transform: translateY(-50%);

    transition:
        opacity .22s ease,
        color .22s ease,
        transform .22s ease;

}


.tool-card__arrow .material-symbols-outlined,
.tool-card__arrow .material-icons {

    font-size: 18px;

    line-height: 1;

}


/* =====================================================
   TOOL CARD ARROW HOVER
===================================================== */

.tool-card:hover .tool-card__arrow {

    color: var(--primary-color);

    opacity: 1;

    transform:
        translateY(-50%)
        translateX(2px);

}


/* =====================================================
   TOOL CARD LINKS
===================================================== */

.tool-card a {

    color: inherit;

    text-decoration: none;

}


.tool-card a:hover {

    color: inherit;

    text-decoration: none;

}


/* =====================================================
   CARD ACTIONS
===================================================== */

.card-actions {

    display: flex;

    flex-wrap: wrap;

    gap: 12px;

    margin-top: 20px;

}


/* =====================================================
   CARD GRID
===================================================== */

.card-grid,
.tools-grid,
.category-tools-grid {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    width: 100%;

    align-items: stretch;

}


/* =====================================================
   CATEGORY TOOL LIST
===================================================== */

#category-tools-list {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    width: 100%;

    align-items: stretch;

}


.category-tools {

    width: 100%;

}


.category-tools > #category-tools-list {

    width: 100%;

}


/* =====================================================
   CATEGORY LIST
===================================================== */

#category-list {

    width: 100%;

}


/* =====================================================
   FEATURE CARD
===================================================== */

.feature-card {

    padding: 32px 24px;

    text-align: center;

}


.feature-card .material-symbols-outlined,
.feature-card .material-icons {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    margin-bottom: 18px;

    color: var(--primary-color);

    font-size: 48px;

    line-height: 1;

    transition:
        transform .22s ease,
        color .22s ease;

}


.feature-card h3 {

    margin: 0 0 12px;

    color: var(--text-color);

    font-size: var(--font-size-lg);

    font-weight: var(--font-bold);

    line-height: 1.4;

}


.feature-card p {

    margin: 0;

    color: var(--text-light-color);

    line-height: 1.7;

}


/* =====================================================
   CATEGORY CARD
   COMPACT VERSION
===================================================== */

.category-card {

    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;

    padding: 14px 16px;

    color: inherit;

    text-decoration: none;

    transition:
        background-color .22s ease,
        transform .22s ease;

}


.category-card .material-symbols-outlined,
.category-card .material-icons {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    flex: 0 0 auto;

    width: 42px;

    height: 42px;

    border-radius: var(--radius-md);

    background: var(--primary-light-color);

    color: var(--primary-color);

    font-size: 26px;

    line-height: 1;

    transition:
        transform .22s ease,
        background-color .22s ease,
        color .22s ease;

}


.category-card h3 {

    margin: 0 0 3px;

    color: var(--text-color);

    font-size: var(--font-size-md);

    font-weight: var(--font-bold);

    line-height: 1.3;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}


.category-card p {

    margin: 0;

    color: var(--text-light-color);

    font-size: var(--font-size-xs);

    line-height: 1.4;

    display: -webkit-box;

    -webkit-line-clamp: 1;

    -webkit-box-orient: vertical;

    overflow: hidden;

}


.category-card:hover {

    transform: translateY(-2px);

}


.category-card:hover .material-symbols-outlined,
.category-card:hover .material-icons {

    transform: scale(1.04);

    background: var(--primary-color);

    color: var(--white);

}


/* =====================================================
   BLOG CARD
===================================================== */

.blog-card img {

    display: block;

    width: 100%;

    aspect-ratio: 16 / 9;

    object-fit: cover;

}


.blog-card .card-body {

    display: flex;

    flex-direction: column;

    gap: 14px;

}


.blog-card h3 {

    margin: 0;

    color: var(--text-color);

    line-height: 1.4;

}


.blog-card p {

    margin: 0;

    color: var(--text-light-color);

    line-height: 1.7;

}


/* =====================================================
   POPULAR TOOL CARD
===================================================== */

.popular-tool-card {

    position: relative;

}


.popular-tool-card::before {

    content: "Popular";

    position: absolute;

    top: 10px;

    right: 10px;

    z-index: 2;

    padding: 3px 8px;

    border-radius: var(--radius-round);

    background: var(--primary-color);

    color: var(--white);

    font-size: var(--font-size-xs);

    font-weight: var(--font-semibold);

    line-height: 1.3;

}


/* =====================================================
   INFO CARD
===================================================== */

.info-card {

    border-left: 4px solid var(--primary-color);

}


.info-card .card-body {

    padding: 22px;

}


/* =====================================================
   CARD IMAGE
===================================================== */

.card-image {

    display: block;

    width: 100%;

    object-fit: cover;

}


/* =====================================================
   CARD BADGE
===================================================== */

.card-badge {

    display: inline-block;

    width: fit-content;

    padding: 6px 12px;

    border-radius: var(--radius-round);

    background: var(--primary-light-color);

    color: var(--primary-hover);

    font-size: var(--font-size-xs);

    font-weight: var(--font-semibold);

    line-height: 1.4;

}


/* =====================================================
   CARD TITLE
===================================================== */

.card-title {

    margin: 0;

    color: var(--text-color);

    transition: color .22s ease;

}


.card:hover .card-title {

    color: var(--primary-color);

}


/* =====================================================
   CARD LINKS
===================================================== */

.card a {

    color: inherit;

    text-decoration: none;

}


.card a:hover {

    color: var(--primary-color);

}


/* =====================================================
   CARD FOCUS
===================================================== */

.card:focus-within {

    outline: var(--focus-width) solid var(--primary-color);

    outline-offset: var(--focus-offset);

}


/* =====================================================
   DARK MODE
===================================================== */

html.dark .card {

    background: var(--surface-color);

    border-color: var(--border-color);

}


html.dark .card-header {

    background: var(--surface-color);

    border-color: var(--border-color);

}


html.dark .card-footer {

    background: var(--surface-2-color);

    border-color: var(--border-color);

}


html.dark .tool-card {

    background: var(--surface-color);

    border-color: var(--border-color);

}


html.dark .tool-card-title,
html.dark .tool-card__title,
html.dark .card-title,
html.dark .category-card h3,
html.dark .blog-card h3,
html.dark .feature-card h3 {

    color: var(--text-color);

}


html.dark .tool-card-description,
html.dark .tool-card__description,
html.dark .tool-card__count,
html.dark .category-card p,
html.dark .blog-card p,
html.dark .feature-card p {

    color: var(--text-light-color);

}


/* =====================================================
   DARK MODE
   TOOL CARD CATEGORY / BADGE
===================================================== */

html.dark .card-badge,
html.dark .tool-card__category {

    background: var(--primary-light-color);

    color: var(--primary-color);

}


/* =====================================================
   DARK MODE
   TOOL CARD HOVER
===================================================== */

html.dark .card:hover .card-title,
html.dark .tool-card:hover .tool-card-title,
html.dark .tool-card:hover .tool-card__title {

    color: var(--primary-color);

}


html.dark .tool-card__icon {

    background: var(--primary-light-color);

    color: var(--primary-color);

}


html.dark .tool-card__arrow {

    color: var(--text-muted-color);

}


html.dark .tool-card:hover .tool-card__arrow {

    color: var(--primary-color);

}


/* =====================================================
   DARK MODE
   CATEGORY ICON
===================================================== */

html.dark .category-card .material-symbols-outlined,
html.dark .category-card .material-icons {

    background: var(--primary-light-color);

    color: var(--primary-color);

}


html.dark .category-card:hover .material-symbols-outlined,
html.dark .category-card:hover .material-icons {

    background: var(--primary-color);

    color: var(--white);

}


/* =====================================================
   RESPONSIVE - LARGE TABLET
===================================================== */

@media (max-width: 1100px) {

    .card-grid,
    .tools-grid,
    .category-tools-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }


    #category-tools-list {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }

}


/* =====================================================
   RESPONSIVE - TABLET
===================================================== */

@media (max-width: 992px) {

    .card-grid,
    .tools-grid,
    .category-tools-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 16px;

    }


    #category-tools-list {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 16px;

    }

}


/* =====================================================
   RESPONSIVE - MOBILE
===================================================== */

@media (max-width: 768px) {

    .card-grid,
    .tools-grid,
    .category-tools-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 14px;

    }


    #category-tools-list {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 14px;

    }


    .card-header,
    .card-body,
    .card-footer {

        padding: 20px;

    }


    .feature-card {

        padding: 24px 20px;

    }


    /* -----------------------------------------
       Compact mobile tool card
    ----------------------------------------- */

    .tool-card {

        min-height: 76px;

        padding: 12px;

        gap: 10px;

    }


    .tool-card__icon {

        width: 38px;

        height: 38px;

    }


    .tool-card__icon .material-symbols-outlined,
    .tool-card__icon .material-icons {

        font-size: 21px;

    }


    .tool-card__content {

        gap: 4px;

        padding-right: 22px;

    }


    .tool-card__title,
    .tool-card-title {

        font-size: var(--font-size-sm);

        line-height: 1.3;

    }


    .tool-card__category {

        padding: 2px 7px;

        font-size: 10px;

    }


    .tool-card__arrow {

        right: 8px;

        width: 24px;

        height: 24px;

    }


    .tool-card__arrow .material-symbols-outlined,
    .tool-card__arrow .material-icons {

        font-size: 16px;

    }


    /* -----------------------------------------
       Compact mobile category card
    ----------------------------------------- */

    .category-card {

        gap: 10px;

        padding: 12px;

    }


    .category-card .material-symbols-outlined,
    .category-card .material-icons {

        width: 38px;

        height: 38px;

        font-size: 23px;

    }


    .category-card h3 {

        font-size: var(--font-size-sm);

    }


    .category-card p {

        font-size: 10px;

    }

}


/* =====================================================
   RESPONSIVE - SMALL MOBILE
===================================================== */

@media (max-width: 480px) {

    .card-actions {

        flex-direction: column;

        width: 100%;

    }


    .card-actions .btn {

        width: 100%;

    }


    .category-card {

        align-items: center;

    }


    /*
     * Keep tools in 2 columns
     * to maximize visible tools.
     */

    .card-grid,
    .tools-grid,
    .category-tools-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;

    }


    #category-tools-list {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;

    }


    .tool-card {

        min-height: 70px;

        padding: 10px;

        gap: 8px;

        border-radius: var(--radius-md);

    }


    .tool-card__icon {

        width: 34px;

        height: 34px;

        border-radius: 8px;

    }


    .tool-card__icon .material-symbols-outlined,
    .tool-card__icon .material-icons {

        font-size: 19px;

    }


    .tool-card__content {

        gap: 3px;

        padding-right: 18px;

    }


    .tool-card__title,
    .tool-card-title {

        font-size: 13px;

        line-height: 1.25;

    }


    .tool-card__category {

        max-width: 100%;

        padding: 1px 6px;

        font-size: 9px;

        line-height: 1.3;

    }


    .tool-card__arrow {

        right: 5px;

        width: 20px;

        height: 20px;

    }


    .tool-card__arrow .material-symbols-outlined,
    .tool-card__arrow .material-icons {

        font-size: 14px;

    }

}


/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {

    .card,
    .tool-card,
    .card-title,
    .tool-card-title,
    .tool-card__title,
    .tool-card__icon,
    .tool-card__arrow,
    .category-card,
    .category-card .material-symbols-outlined,
    .category-card .material-icons {

        transition: none !important;

        animation: none !important;

    }


    .card:hover,
    .tool-card:hover,
    .category-card:hover {

        transform: none !important;

    }


    .tool-card:hover .tool-card__icon {

        transform: none !important;

    }


    .tool-card:hover .tool-card__arrow {

        transform: translateY(-50%) !important;

    }


    .category-card:hover .material-symbols-outlined,
    .category-card:hover .material-icons {

        transform: none !important;

    }

}


/* =====================================================
   PRINT
===================================================== */

@media print {

    .card,
    .tool-card {

        box-shadow: none !important;

        transform: none !important;

        break-inside: avoid;

    }


    .popular-tool-card::before {

        display: none;

    }


    .tool-card__arrow {

        display: none;

    }

}


/* =====================================================
   END OF CARD.CSS v3.2
===================================================== */