
@keyframes atSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes atCheckPop {
    0%   { transform: scale(0) rotate(-45deg); opacity: 0; }
    60%  { transform: scale(1.25) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes atStreakGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(251, 191, 36, 0.4); }
    50%        { box-shadow: 0 0 24px rgba(251, 191, 36, 0.8); }
}

@keyframes atNumberRoll {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes atPulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(20, 184, 166, 0); }
    100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}

@keyframes atShimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes atFadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.at-section {
    padding: 0 20px;
    margin-bottom: 20px;
    position: relative;
}

@media (min-width: 768px) {
    .at-section {
        padding: 0 28px;
        margin-bottom: 24px;
    }
}

.at-card {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.97) 0%,
        rgba(240, 253, 250, 0.95) 100%);
    border: 1px solid rgba(20, 184, 166, 0.18);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(20, 184, 166, 0.10),
        0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    animation: atSlideDown 0.45s ease both;
}

.at-card:hover {
    box-shadow:
        0 12px 40px rgba(20, 184, 166, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.06);
}

.at-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 22px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.at-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.at-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.at-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 3px;
    line-height: 1.2;
}

.at-subtitle {
    font-size: 0.73rem;
    font-weight: 600;
    color: #0F766E;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Insight banner (e.g. "You acted on 3 insights today") */
.at-insight-banner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(14, 165, 233, 0.12));
    border: 1px solid rgba(20, 184, 166, 0.25);
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f766e;
    white-space: nowrap;
    flex-shrink: 0;
}

.at-insight-banner i {
    color: #0F766E;
    font-size: 0.82rem;
}

.at-stats-row {
    display: flex;
    gap: 10px;
    padding: 16px 22px 0;
    flex-wrap: wrap;
}

.at-stat-chip {
    flex: 1;
    min-width: 0;
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.at-stat-chip:hover {
    transform: translateY(-2px);
}

.at-stat-chip--recs {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(20, 184, 166, 0.15));
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.at-stat-chip--urges {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.at-stat-chip--interventions {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.at-stat-chip-num {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    animation: atNumberRoll 0.4s ease both;
}

.at-stat-chip--recs .at-stat-chip-num   { color: #0F766E; }
.at-stat-chip--urges .at-stat-chip-num  { color: #8b5cf6; }
.at-stat-chip--interventions .at-stat-chip-num { color: #B45309; }

.at-stat-chip-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.at-stat-chip-icon {
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.at-stat-chip--recs .at-stat-chip-icon        { color: #0F766E; }
.at-stat-chip--urges .at-stat-chip-icon       { color: #8b5cf6; }
.at-stat-chip--interventions .at-stat-chip-icon { color: #B45309; }

.at-streak-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 22px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(249, 115, 22, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 14px;
}

.at-streak-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
    animation: atStreakGlow 2.5s ease-in-out infinite;
}

.at-streak-info {
    flex: 1;
    min-width: 0;
}

.at-streak-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 1px;
}

.at-streak-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #78350f;
}

.at-streak-dots {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.at-streak-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: background 0.3s ease;
}

.at-streak-dot.active {
    background: linear-gradient(135deg, #fbbf24, #f97316);
}

.at-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px 8px;
}

.at-list-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.at-list-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
}

.at-list {
    padding: 0 22px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Individual action item */
.at-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1.5px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.25s ease;
    cursor: default;
    animation: atFadeInUp 0.35s ease both;
    position: relative;
    overflow: hidden;
}

.at-item.completed {
    background: rgba(20, 184, 166, 0.05);
    border-color: rgba(20, 184, 166, 0.2);
}

.at-item.urge-resisted {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
}

.at-item.intervention {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}

.at-item-check {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    color: #fff;
}

.at-item.completed .at-item-check {
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    animation: atCheckPop 0.4s ease both;
}

.at-item.urge-resisted .at-item-check {
    background: linear-gradient(135deg, #8b5cf6, #a594f9);
    animation: atCheckPop 0.4s ease both;
}

.at-item.intervention .at-item-check {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    animation: atCheckPop 0.4s ease both;
}

.at-item-text {
    flex: 1;
    min-width: 0;
}

.at-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.at-item-meta {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.at-item-type {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.at-item.completed .at-item-type {
    background: rgba(20, 184, 166, 0.12);
    color: #0f766e;
}

.at-item.urge-resisted .at-item-type {
    background: rgba(139, 92, 246, 0.12);
    color: #6d28d9;
}

.at-item.intervention .at-item-type {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

.at-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 22px;
    text-align: center;
}

.at-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(14, 165, 233, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #0F766E;
}

.at-empty-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin: 0;
}

.at-empty-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

.at-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.03), rgba(14, 165, 233, 0.03));
    margin-top: 12px;
}

.at-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0F766E;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
}

.at-footer-link:hover {
    color: #0f766e;
    gap: 8px;
}

.at-footer-link .fa-chevron-right {
    font-size: 0.68rem;
    transition: transform 0.25s ease;
}

.at-footer-link:hover .fa-chevron-right {
    transform: translateX(3px);
}

.at-skeleton {
    padding: 20px 22px 22px;
}

.at-skel-bar {
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% auto;
    animation: atShimmer 1.5s linear infinite;
    margin-bottom: 10px;
}

.at-skel-bar:last-child { margin-bottom: 0; }
.at-skel-bar.short      { width: 55%; }
.at-skel-bar.medium     { width: 75%; }
.at-skel-bar.long       { width: 100%; }

@media (max-width: 480px) {
    .at-section { padding: 0 14px; margin-bottom: 16px; }
    .at-card   { border-radius: 20px; }
    .at-card-header { padding: 16px 16px 0; }
    .at-stats-row { padding: 12px 16px 0; gap: 8px; }
    .at-stat-chip { padding: 10px 10px; }
    .at-stat-chip-num { font-size: 1.5rem; }
    .at-streak-bar { margin: 12px 16px 0; }
    .at-list-header { padding: 12px 16px 6px; }
    .at-list { padding: 0 16px 4px; }
    .at-footer { padding: 12px 16px; }
    .at-empty { padding: 20px 16px; }
    .at-insight-banner { font-size: 0.72rem; padding: 5px 10px; }
}

@media (min-width: 768px) {
    .at-card-header { padding: 22px 28px 0; }
    .at-stats-row   { padding: 18px 28px 0; gap: 14px; }
    .at-streak-bar  { margin: 16px 28px 0; }
    .at-list-header { padding: 18px 28px 8px; }
    .at-list        { padding: 0 28px 4px; }
    .at-footer      { padding: 16px 28px; }
    .at-empty       { padding: 28px 28px; }
}

[data-theme="dark"] .at-card,
.dark-mode .at-card {
    background: linear-gradient(135deg,
        rgba(15, 23, 42, 0.96) 0%,
        rgba(30, 41, 59, 0.92) 100%);
    border-color: rgba(20, 184, 166, 0.22);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .at-title,
.dark-mode .at-title { color: #f1f5f9; }

[data-theme="dark"] .at-item,
.dark-mode .at-item {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .at-item.completed,
.dark-mode .at-item.completed {
    background: rgba(20, 184, 166, 0.08);
    border-color: rgba(20, 184, 166, 0.25);
}

[data-theme="dark"] .at-item.urge-resisted,
.dark-mode .at-item.urge-resisted {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.25);
}

[data-theme="dark"] .at-item.intervention,
.dark-mode .at-item.intervention {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .at-item-name,
.dark-mode .at-item-name { color: #e2e8f0; }

[data-theme="dark"] .at-list-title,
.dark-mode .at-list-title { color: #94a3b8; }

[data-theme="dark"] .at-streak-bar,
.dark-mode .at-streak-bar {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), rgba(249, 115, 22, 0.06));
    border-color: rgba(251, 191, 36, 0.18);
}

[data-theme="dark"] .at-streak-label,
.dark-mode .at-streak-label { color: #fbbf24; }

[data-theme="dark"] .at-streak-value,
.dark-mode .at-streak-value { color: #fde68a; }

[data-theme="dark"] .at-footer,
.dark-mode .at-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
    background: rgba(20, 184, 166, 0.04);
}

[data-theme="dark"] .at-insight-banner,
.dark-mode .at-insight-banner {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(14, 165, 233, 0.15));
    border-color: rgba(20, 184, 166, 0.3);
    color: #5eead4;
}

[data-theme="dark"] .at-empty-title,
.dark-mode .at-empty-title { color: #e2e8f0; }
