/* ═══════════════════════════════════════════════════════════════
   AGENTS UI POLISH v1.0 — Visual Refinements
   Enhances spacing, icons, hover animations, and visual hierarchy
   for the Agents showcase page and cards.
   Applied AFTER agent-studio.css
   ═══════════════════════════════════════════════════════════════ */

/* ─── Better Feature Bullet Dots ──────────────────────────── */
/* Replace emoji feat-icon with clean colored dots */
.agent-showcase-features li span.feat-icon {
    font-size: 0.5rem !important;
    width: 6px;
    height: 6px;
    min-width: 6px;
    display: inline-block;
    line-height: 1;
    opacity: 0.7;
}

.gmail-card .agent-showcase-features li span.feat-icon {
    color: #f87171;
}

.drive-card .agent-showcase-features li span.feat-icon {
    color: #34d399;
}

.calendar-card .agent-showcase-features li span.feat-icon {
    color: #818cf8;
}

/* ─── Card Hover — Refined Elevation + Glow ──────────────── */
.agent-showcase-card {
    border: 1px solid rgba(255, 255, 255, 0.06);
    will-change: transform, box-shadow;
}

.agent-showcase-card:hover {
    transform: translateY(-6px) !important;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 30px var(--card-glow, rgba(99, 102, 241, 0.08)) !important;
    border-color: rgba(255, 255, 255, 0.10);
}

.agent-showcase-card.gmail-card {
    --card-glow: rgba(248, 113, 113, 0.08);
}

.agent-showcase-card.drive-card {
    --card-glow: rgba(52, 211, 153, 0.08);
}

.agent-showcase-card.calendar-card {
    --card-glow: rgba(129, 140, 248, 0.08);
}

/* ─── Card Gradient Border — Smoother ────────────────────── */
.agent-showcase-card::before {
    transition: opacity 0.35s ease !important;
}

.agent-showcase-card:hover::before {
    opacity: 0.9 !important;
}

/* ─── Icon Container — Responsive Fill SVGs ──────────────── */
.agent-showcase-icon {
    border-radius: 14px !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.agent-showcase-card:hover .agent-showcase-icon {
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.agent-showcase-icon svg {
    width: 26px !important;
    height: 26px !important;
}

/* ─── Feature List — Better Spacing ──────────────────────── */
.agent-showcase-features {
    margin: 0 0 22px !important;
}

.agent-showcase-features li {
    padding: 6px 0 !important;
    font-size: 0.76rem !important;
    color: rgba(228, 228, 231, 0.65) !important;
    transition: color 0.2s ease;
}

.agent-showcase-card:hover .agent-showcase-features li {
    color: rgba(228, 228, 231, 0.8) !important;
}

/* ─── Tagline — Better Contrast ──────────────────────────── */
.agent-showcase-tagline {
    font-size: 0.78rem !important;
    color: rgba(161, 161, 170, 0.55) !important;
    margin-bottom: 18px !important;
    line-height: 1.4;
}

/* ─── Name — Sharper ─────────────────────────────────────── */
.agent-showcase-name {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.3px !important;
}

/* ─── Footer — Better Alignment ──────────────────────────── */
.agent-showcase-footer {
    padding-top: 16px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* ─── Explore Button — Smoother Hover ────────────────────── */
.agent-showcase-btn.explore-btn {
    border-radius: 10px !important;
    padding: 10px 24px !important;
    font-size: 0.82rem !important;
    font-weight: 620 !important;
    letter-spacing: -0.1px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative;
    overflow: hidden;
}

.agent-showcase-btn.explore-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.agent-showcase-btn.explore-btn:hover::after {
    opacity: 1;
}

.agent-showcase-btn.explore-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.28) !important;
}

.agent-showcase-btn.explore-btn:active {
    transform: translateY(0) scale(0.97) !important;
}

/* ─── Status Dot — Pulse Animation ───────────────────────── */
.agent-showcase-status .agent-card-status-dot.connected {
    animation: agentDotPulse 2.4s ease-in-out infinite;
}

@keyframes agentDotPulse {

    0%,
    100% {
        box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
    }

    50% {
        box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
    }
}

/* ─── Hero Section — Polish ──────────────────────────────── */
.agents-page-hero {
    margin-bottom: 48px !important;
}

.agents-page-hero-icon {
    width: 68px !important;
    height: 68px !important;
    border-radius: 22px !important;
    margin-bottom: 20px !important;
    transition: transform 0.3s ease;
}

.agents-page-hero-icon:hover {
    transform: scale(1.08);
}

.agents-page-hero h1 {
    font-size: 1.7rem !important;
    letter-spacing: -0.6px !important;
}

.agents-page-hero p {
    font-size: 0.92rem !important;
    line-height: 1.6 !important;
}

/* ─── Grid — Better Gap + Breathing Room ─────────────────── */
.agents-page-grid {
    gap: 24px !important;
}

/* ─── Stagger Entrance Animation ─────────────────────────── */
.agent-showcase-card {
    animation: agCardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.agent-showcase-card:nth-child(1) {
    animation-delay: 0.08s;
}

.agent-showcase-card:nth-child(2) {
    animation-delay: 0.16s;
}

.agent-showcase-card:nth-child(3) {
    animation-delay: 0.24s;
}

@keyframes agCardEntrance {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Close/Back Button — Better Size ────────────────────── */
.agents-page-back {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    transition: all 0.25s ease !important;
}

.agents-page-back:hover {
    background: rgba(255, 255, 255, 0.10) !important;
    transform: rotate(90deg);
}

/* ─── Dark Mode — Full Opaque Overlay (prevents homepage bleed) ── */
:root.dark .agents-page-overlay {
    background: #0b0b0b !important;
    backdrop-filter: none !important;
}

:root.dark .agent-showcase-card {
    background: #161616 !important;
    border: 1px solid #2a2a2a !important;
}

:root.dark .agent-showcase-card:hover {
    background: #1a1a1a !important;
    border-color: #3a3a3a !important;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 30px var(--card-glow, rgba(99, 102, 241, 0.06)) !important;
}

:root.dark .agent-showcase-name {
    color: #e5e5e5 !important;
}

:root.dark .agent-showcase-tagline {
    color: #9ca3af !important;
}

:root.dark .agent-showcase-features li {
    color: rgba(228, 228, 231, 0.6) !important;
}

:root.dark .agents-page-hero h1 {
    color: #e5e5e5 !important;
}

:root.dark .agents-page-hero p {
    color: #9ca3af !important;
}

:root.dark .agent-showcase-footer {
    border-top-color: #2a2a2a !important;
}

:root.dark .agent-card-status-label {
    color: #9ca3af !important;
}

:root.dark .agents-page-back {
    background: #161616 !important;
    border-color: #2a2a2a !important;
    color: #e5e5e5 !important;
}

:root.dark .agents-page-back:hover {
    background: #1f1f1f !important;
    border-color: #3a3a3a !important;
}

:root.dark .agents-page-hero-icon {
    background: #161616 !important;
    border: 1px solid #2a2a2a !important;
}

/* ─── Dark Mode — Agent Panel Modal Fix ──────────────────── */
:root.dark .ap-overlay {
    background: rgba(0, 0, 0, 0.65) !important;
}

:root.dark .ap-panel {
    background: #161616 !important;
    border: 1px solid #2a2a2a !important;
    backdrop-filter: blur(40px) !important;
}

:root.dark .ap-header {
    border-bottom-color: #2a2a2a !important;
}

:root.dark .ap-title {
    color: #e5e5e5 !important;
}

:root.dark .ap-desc {
    color: #9ca3af !important;
}

:root.dark .ap-section {
    border-bottom-color: #2a2a2a !important;
}

:root.dark .ap-section-label {
    color: #6b7280 !important;
}

:root.dark .ap-scope-badge {
    background: #1f1f1f !important;
    border-color: #2a2a2a !important;
    color: #9ca3af !important;
}

:root.dark .ap-btn-test {
    background: #1f1f1f !important;
    border-color: #2a2a2a !important;
    color: #9ca3af !important;
}

:root.dark .ap-btn-test:hover {
    background: #252525 !important;
    border-color: #3a3a3a !important;
    color: #e5e5e5 !important;
}

:root.dark .ap-btn-disconnect {
    background: transparent !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #f87171 !important;
}

/* ─── Light Mode Adjustments ─────────────────────────────── */
:root.light .agents-page-overlay {
    background: #f5f5f5 !important;
    backdrop-filter: none !important;
}

:root.light .agent-showcase-card {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

:root.light .agent-showcase-card:hover {
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.08),
        0 0 30px var(--card-glow, rgba(99, 102, 241, 0.06)) !important;
    border-color: #d1d5db !important;
}

:root.light .agent-showcase-name {
    color: #111827 !important;
}

:root.light .agent-showcase-tagline {
    color: #6b7280 !important;
}

:root.light .agent-showcase-features li {
    color: #374151 !important;
}

:root.light .agents-page-hero h1 {
    color: #111827 !important;
}

:root.light .agents-page-hero p {
    color: #6b7280 !important;
}

:root.light .agent-showcase-footer {
    border-top-color: #e5e5e5 !important;
}

:root.light .agent-card-status-label {
    color: #6b7280 !important;
}

:root.light .agents-page-back {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
    color: #374151 !important;
}

:root.light .agents-page-hero-icon {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

/* ─── Light Mode — Agent Panel Modal ─────────────────────── */
:root.light .ap-overlay {
    background: rgba(0, 0, 0, 0.25) !important;
}

:root.light .ap-panel {
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12) !important;
}

:root.light .ap-header {
    border-bottom-color: #e5e5e5 !important;
}

:root.light .ap-title {
    color: #111827 !important;
}

:root.light .ap-desc {
    color: #6b7280 !important;
}

:root.light .ap-section {
    border-bottom-color: #f3f4f6 !important;
}

:root.light .ap-section-label {
    color: #9ca3af !important;
}

:root.light .ap-scope-badge {
    background: #f9fafb !important;
    border-color: #e5e5e5 !important;
    color: #374151 !important;
}

:root.light .ap-btn-test {
    background: #f9fafb !important;
    border-color: #e5e5e5 !important;
    color: #374151 !important;
}

:root.light .ap-btn-test:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

:root.light .ap-close-btn {
    background: #f9fafb !important;
    border-color: #e5e5e5 !important;
    color: #6b7280 !important;
}

:root.light .ap-close-btn:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

/* ─── Mobile Polish ──────────────────────────────────────── */
@media (max-width: 600px) {
    .agents-page {
        padding: 24px 16px 60px !important;
    }

    .agents-page-hero {
        margin-bottom: 32px !important;
    }

    .agents-page-hero h1 {
        font-size: 1.35rem !important;
    }

    .agent-showcase-card {
        padding: 24px 20px !important;
        border-radius: 18px !important;
    }

    .agent-showcase-icon {
        width: 48px !important;
        height: 48px !important;
    }

    .agent-showcase-icon svg {
        width: 22px !important;
        height: 22px !important;
    }

    .agent-showcase-btn.explore-btn {
        padding: 10px 18px !important;
        font-size: 0.78rem !important;
    }
}