/* ==========================================================================
   UTILITY DECK - SHADCN DARK THEME STYLESHEET
   Font: Comfortaa (Google Fonts)
   ========================================================================== */

:root {
    --bg-color: #09090b;
    --card-bg: #121217;
    --card-hover: #18181f;
    --border: #27272a;
    --border-hover: #3f3f46;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --accent-emerald: #10b981;
    --font-family: 'Comfortaa', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Subtle Dot/Grid Pattern */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: -1;
    pointer-events: none;
}

/* Layout Wrapper */
.deck-wrapper {
    width: 100%;
    max-width: 1120px;
    padding: 40px 20px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 0 auto;
}

/* Header */
.deck-header {
    width: 100%;
    text-align: center;
    margin-bottom: 36px;
    position: relative;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.deck-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.deck-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Responsive Shadcn Grid System */
.deck-content {
    width: 100%;
}

.tool-grid {
    display: grid;
    width: 100%;
    gap: 16px;
    /* Default: 3 columns for desktop */
    grid-template-columns: repeat(3, 1fr);
}

/* Screens > 1024px: 3 Columns */
@media (min-width: 1024px) {
    .tool-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Tablets (768px - 1023px): 2 or 3 Columns */
@media (max-width: 1023px) and (min-width: 768px) {
    .tool-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Phones (420px - 767px): Exactly 2 tiles per row */
@media (max-width: 767px) and (min-width: 420px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .tool-card {
        padding: 16px;
    }

    .card-title {
        font-size: 0.95rem !important;
    }

    .card-desc {
        font-size: 0.78rem !important;
        -webkit-line-clamp: 3;
    }
}

/* Very Small Screens (< 420px): Exactly 1 card per row */
@media (max-width: 419px) {
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .deck-title {
        font-size: 1.75rem;
    }
}

/* Shadcn Card Architecture */
.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-3px);
    background: var(--card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-hover);
}

.tool-card.offline {
    opacity: 0.55;
    cursor: not-allowed;
}

.tool-card.offline .icon-box {
    color: #64748b !important;
    border-color: #27272a !important;
    background: rgba(255, 255, 255, 0.02) !important;
    filter: grayscale(100%);
}

.tool-card.offline:hover {
    transform: none;
    box-shadow: none;
    background: var(--card-bg);
    border-color: var(--border);
}

.tool-card.offline:hover .icon-box {
    transform: none;
    border-color: #27272a !important;
    color: #64748b !important;
}

.tool-card.offline .card-title {
    color: #94a3b8;
}

.tool-card.offline .badge-pill {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #64748b !important;
    border-color: #27272a !important;
}

/* Card Header: Icon & Green Dot */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.icon-box {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--card-accent, #10b981);
    transition: all 0.2s ease;
}

.icon-box svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.tool-card:hover .icon-box {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--card-accent, #10b981);
    transform: scale(1.05);
}

/* Status Indicator with Green Dot */
.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-dot.online {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.status-dot.online::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.35);
    animation: statusPulse 2s infinite ease-out;
}

.status-dot.offline {
    background-color: #52525b;
}

@keyframes statusPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.9;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* Card Body */
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.card-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 18px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    text-transform: uppercase;
}

.card-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.tool-card:hover .card-arrow {
    color: #ffffff;
    transform: translateX(3px);
}

/* ==========================================================================
   Mobile Anti-Zoom & Touch Safeguards
   ========================================================================== */
html, body {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

input, select, textarea, button, a {
    touch-action: manipulation;
}

@media screen and (max-width: 850px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

