/* =========================================================
   AI WITH EVERYONE
   Category Page
   ========================================================= */

:root {
    --aiwe-category-text: #1f2937;
    --aiwe-category-text-secondary: #6b7280;
    --aiwe-category-border: #e5e7eb;
    --aiwe-category-border-hover: #c7d2fe;
    --aiwe-category-surface: #ffffff;
    --aiwe-category-surface-soft: #f8fafc;
    --aiwe-category-primary: #4f46e5;
    --aiwe-category-primary-soft: #eef2ff;
    --aiwe-category-success: #15803d;
    --aiwe-category-success-soft: #f0fdf4;
    --aiwe-category-radius: 16px;
    --aiwe-category-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    --aiwe-category-shadow-hover: 0 16px 36px rgba(79, 70, 229, 0.10);
}

/* =========================================================
   Header
   ========================================================= */

.aiwe-category-page-header {
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fbfcff 100%
        );
    border-bottom: 1px solid var(--aiwe-category-border);
}

.aiwe-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--aiwe-category-text-secondary);
    font-size: 0.88rem;
    text-decoration: none !important;
    transition:
        color 0.18s ease,
        transform 0.18s ease;
}

.aiwe-back-link:hover {
    color: var(--aiwe-category-primary);
    text-decoration: none !important;
    transform: translateX(-2px);
}

/* =========================================================
   Hero
   ========================================================= */

.aiwe-category-hero {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 26px 28px;
    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #fafbff 58%,
            #f5f6ff 100%
        );
    border: 1px solid var(--aiwe-category-border);
    border-radius: var(--aiwe-category-radius);
    box-shadow: var(--aiwe-category-shadow);
}

.aiwe-category-hero-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--aiwe-category-primary);
    background:
        linear-gradient(
            135deg,
            #eef2ff 0%,
            #e8ebff 100%
        );
    border: 1px solid #dfe3ff;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.08);
}

.aiwe-category-hero-icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.8;
}

.aiwe-category-eyebrow {
    margin-bottom: 8px;
    color: #697386;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.aiwe-category-title {
    margin: 0 0 10px 0;
    color: #111827;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 700;
    line-height: 1.25;
}

.aiwe-category-subtitle {
    margin: 0;
    color: var(--aiwe-category-text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

/* =========================================================
   Summary Card
   ========================================================= */

.aiwe-category-summary-card {
    position: relative;
    padding: 26px;
    background: var(--aiwe-category-surface);
    border: 1px solid var(--aiwe-category-border);
    border-radius: var(--aiwe-category-radius);
    box-shadow: var(--aiwe-category-shadow);
    overflow: hidden;
}

.aiwe-category-summary-card::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    right: -55px;
    bottom: -70px;
    background:
        radial-gradient(
            circle,
            rgba(99, 102, 241, 0.10) 0%,
            rgba(99, 102, 241, 0) 70%
        );
    pointer-events: none;
}

.aiwe-summary-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--aiwe-category-primary);
    background-color: var(--aiwe-category-primary-soft);
    border-radius: 12px;
}

.aiwe-summary-icon svg {
    width: 20px;
    height: 20px;
}

.aiwe-summary-count {
    color: #111827;
    font-size: 1.05rem;
    font-weight: 700;
}

.aiwe-summary-progress {
    margin-top: 8px;
    color: var(--aiwe-category-text-secondary);
    font-size: 0.88rem;
}

/* =========================================================
   Task Section
   ========================================================= */

.aiwe-category-task-section {
    background: #f8fafc;
}

.aiwe-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.aiwe-task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.aiwe-task-access-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.aiwe-task-access-trial {
    color: #3730a3;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
}

.aiwe-task-access-preview {
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}


/* =========================================================
   Task Card
   ========================================================= */

.aiwe-task-card {
    position: relative;
    color: var(--aiwe-category-text);
    background: var(--aiwe-category-surface);
    border: 1px solid var(--aiwe-category-border);
    border-radius: var(--aiwe-category-radius);
    box-shadow: var(--aiwe-category-shadow);
    overflow: hidden;
    margin-top: 4px;
    margin-bottom: 14px;
    height: calc(100% - 18px) !important;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease;
}

.aiwe-task-card:hover {
    border-color: var(--aiwe-category-border-hover);
    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f8faff 60%,
            #f3f4ff 100%
        );
    box-shadow: var(--aiwe-category-shadow-hover);
    transform: translateY(-4px);
}

.aiwe-task-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background:
        linear-gradient(
            180deg,
            #818cf8 0%,
            #c4b5fd 100%
        );
    opacity: 0;
    transition: opacity 0.22s ease;
}

.aiwe-task-card:hover::before {
    opacity: 1;
}

/* =========================================================
   Task Number
   ========================================================= */

.aiwe-task-number {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    color: var(--aiwe-category-primary);
    background-color: var(--aiwe-category-primary-soft);
    border: 1px solid #dfe3ff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* =========================================================
   Favorite
   ========================================================= */

.aiwe-favorite-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 5px 10px;
    color: #6b7280;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.aiwe-favorite-button:hover {
    color: #4f46e5;
    background-color: #f8faff;
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
}

.aiwe-favorite-button.is-favorite {
    color: #a16207;
    background-color: #fefce8;
    border-color: #fde68a;
}

.aiwe-favorite-button.is-favorite svg {
    fill: currentColor;
}

.aiwe-favorite-button:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.16);
    outline-offset: 2px;
}

/* =========================================================
   Task Main Link
   ========================================================= */

.aiwe-task-main-link {
    display: block;
    color: inherit;
    text-decoration: none !important;
}

.aiwe-task-main-link:hover,
.aiwe-task-main-link:focus,
.aiwe-task-main-link:visited {
    color: inherit;
    text-decoration: none !important;
}

.aiwe-task-title {
    margin: 0 0 10px 0;
    color: #111827;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.45;
    text-decoration: none !important;
}

.aiwe-task-summary {
    margin: 0 0 22px 0;
    color: var(--aiwe-category-text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
    text-decoration: none !important;
}

/* =========================================================
   Task Footer
   ========================================================= */

.aiwe-task-footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding-top: 18px;
    border-top: 1px solid #f0f1f4;
}

.aiwe-task-time {
    color: #6b7280;
    font-size: 0.8rem;
}

.aiwe-task-status {
    margin-top: 5px;
    color: #8a94a3;
    font-size: 0.8rem;
}

.aiwe-task-status.aiwe-progress-completed,
.aiwe-task-card .aiwe-progress-completed {
    color: var(--aiwe-category-success);
    font-weight: 600;
}

.aiwe-task-open-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    color: #5b63d3;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none !important;
    transition:
        color 0.18s ease,
        gap 0.18s ease;
}

.aiwe-task-open-link:hover {
    color: #4338ca;
    gap: 9px;
    text-decoration: none !important;
}

/* =========================================================
   Accessibility
   ========================================================= */

.aiwe-task-main-link:focus-visible,
.aiwe-task-open-link:focus-visible,
.aiwe-back-link:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.16);
    outline-offset: 3px;
    border-radius: 8px;
}

/* =========================================================
   Reduced Motion
   ========================================================= */

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

    .aiwe-task-card,
    .aiwe-back-link,
    .aiwe-task-open-link,
    .aiwe-favorite-button {
        transition: none;
    }

    .aiwe-task-card:hover,
    .aiwe-back-link:hover {
        transform: none;
    }
}

/* =========================================================
   Tablet / Mobile
   ========================================================= */

@media (max-width: 991.98px) {

    .aiwe-category-hero,
    .aiwe-category-summary-card {
        min-height: auto;
    }
}

@media (max-width: 767.98px) {

    .aiwe-category-hero {
        padding: 22px;
        gap: 16px;
    }

    .aiwe-category-hero-icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }

    .aiwe-category-hero-icon svg {
        width: 23px;
        height: 23px;
    }

    .aiwe-category-summary-card {
        padding: 22px;
    }

    .aiwe-task-card .card-body {
        padding: 20px !important;
    }

    .aiwe-section-heading {
        margin-bottom: 20px;
    }
}

/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 575.98px) {

    .aiwe-category-hero {
        display: block;
    }

    .aiwe-category-hero-icon {
        margin-bottom: 16px;
    }

    .aiwe-category-title {
        font-size: 1.65rem;
    }

    .aiwe-task-footer {
        align-items: center;
    }

    .aiwe-task-open-link span {
        display: none;
    }

    .aiwe-favorite-button span {
        display: none;
    }

    .aiwe-favorite-button {
        width: 36px;
        padding: 0;
    }
}


/* =========================================================
   Bootstrap 5.3 Color Modes
   ========================================================= */

[data-bs-theme="dark"] {
    --aiwe-category-text: #e5e7eb;
    --aiwe-category-text-secondary: #94a3b8;
    --aiwe-category-border: #334155;
    --aiwe-category-border-hover: #6366f1;
    --aiwe-category-surface: #111827;
    --aiwe-category-surface-soft: #172033;
    --aiwe-category-primary: #a5b4fc;
    --aiwe-category-primary-soft: rgba(99, 102, 241, 0.16);
    --aiwe-category-success: #86efac;
    --aiwe-category-success-soft: rgba(34, 197, 94, 0.12);
    --aiwe-category-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
    --aiwe-category-shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.30);
}

[data-bs-theme="dark"] .aiwe-category-page-header {
    background: linear-gradient(
        180deg,
        #111827 0%,
        #0f172a 100%
    );
}

[data-bs-theme="dark"] .aiwe-category-hero {
    background: linear-gradient(
        135deg,
        #111827 0%,
        #151d2d 58%,
        #172033 100%
    );
}

[data-bs-theme="dark"] .aiwe-category-hero-icon,
[data-bs-theme="dark"] .aiwe-summary-icon,
[data-bs-theme="dark"] .aiwe-task-number {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(129, 140, 248, 0.38);
}

[data-bs-theme="dark"] .aiwe-category-title,
[data-bs-theme="dark"] .aiwe-summary-count,
[data-bs-theme="dark"] .aiwe-task-title {
    color: #f8fafc;
}

[data-bs-theme="dark"] .aiwe-category-task-section {
    background: #0f172a;
}

[data-bs-theme="dark"] .aiwe-category-summary-card,
[data-bs-theme="dark"] .aiwe-task-card {
    background: var(--aiwe-category-surface);
    border-color: var(--aiwe-category-border);
}

[data-bs-theme="dark"] .aiwe-task-card:hover {
    background: linear-gradient(
        135deg,
        #111827 0%,
        #172033 100%
    );
}

[data-bs-theme="dark"] .aiwe-task-access-trial {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(129, 140, 248, 0.42);
}

[data-bs-theme="dark"] .aiwe-task-access-preview {
    color: #cbd5e1;
    background: #172033;
    border-color: #334155;
}

[data-bs-theme="dark"] .aiwe-favorite-button {
    color: #cbd5e1;
    background: #111827;
    border-color: #334155;
}

[data-bs-theme="dark"] .aiwe-favorite-button:hover {
    color: #c7d2fe;
    background: #172033;
    border-color: #6366f1;
}

[data-bs-theme="dark"] .aiwe-favorite-button.is-favorite {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(250, 204, 21, 0.42);
}
