:root { 
    --primary: #3b82f6; 
    --secondary: #6366f1; 
    --bg: #050505; 
    --card-bg: rgba(20, 20, 22, 0.6); 
    --card-hover: rgba(30, 30, 35, 0.8);
    --border: rgba(255, 255, 255, 0.08); 
    --text-dim: #9ca3af; 
    --sidebar-width: 280px; 
    --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Outfit', sans-serif; background-color: var(--bg); color: white; min-height: 100vh; overflow-x: hidden; }
.text-gradient { background: linear-gradient(45deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar V2 - Collapsible, sober and modern */
.sidebar { 
    width: 78px; 
    background: rgba(10, 10, 12, 0.95); 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    padding: 2rem 12px; 
    flex-shrink: 0;
    z-index: 100;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.4s ease;
    overflow: hidden;
}
.sidebar:hover {
    width: 280px;
    padding: 2rem 1.5rem;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.5);
}

.sidebar-logo { 
    font-size: 1.4rem; 
    font-weight: 800; 
    margin-bottom: 2.5rem; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    overflow: hidden;
}
.sidebar-logo-icon { 
    background: var(--primary); 
    width: 32px; 
    height: 32px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); 
    flex-shrink: 0;
}

.filter-pill {
    display: flex; 
    align-items: center; 
    padding: 10px 12px; 
    color: var(--text-dim); 
    text-decoration: none; 
    border-radius: 10px; 
    font-size: 0.9rem; 
    font-weight: 600; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    cursor: pointer; 
    margin-bottom: 4px; 
    border: 1px solid transparent;
    overflow: hidden;
}
.filter-pill:hover { color: #fff; background: rgba(255,255,255,0.05); }
.filter-pill.active { 
    color: white; 
    background: rgba(59, 130, 246, 0.1); 
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.05);
}
.filter-pill i { 
    width: 24px; 
    height: 24px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0; 
}
.filter-pill.active i { color: var(--primary); }

/* Sliding transitions for sidebar labels */
.sidebar-logo-text,
.sidebar-title,
.filter-pill span,
.stats-box-text {
    max-width: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: max-width 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.25s ease, visibility 0.25s;
    display: inline-block;
    vertical-align: middle;
    overflow: hidden;
}
.sidebar:hover .sidebar-logo-text {
    max-width: 200px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0.05s;
}
.sidebar:hover .sidebar-title {
    max-width: 200px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0.05s;
}
.sidebar:hover .filter-pill span {
    max-width: 200px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    margin-left: 12px;
    transition-delay: 0.05s;
}
.sidebar:hover .stats-box-text {
    max-width: 200px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0.05s;
}

.sidebar-title {
    font-size: 0.65rem; 
    font-weight: 800; 
    color: rgba(255,255,255,0.3); 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    margin-bottom: 10px; 
    display: block;
    padding-left: 12px;
    white-space: nowrap;
}

.stats-box {
    margin-top: auto;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 52px;
    transition: all 0.35s ease;
}
.stats-box i {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.sidebar:not(:hover) .stats-box {
    justify-content: center;
}
.sidebar:not(:hover) .stats-box i {
    margin-left: 0 !important;
}

/* Main Content Area */
.main-content { 
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    position: relative;
}

/* Top Bar */
.top-bar { 
    display: flex; align-items: center; justify-content: space-between; 
    margin-bottom: 2rem; 
    padding-bottom: 1rem;
}

.search-bar { 
    position: relative; 
    width: 450px; 
}
.search-bar input { 
    width: 100%; 
    background: rgba(255,255,255,0.03); 
    border: 1px solid var(--border); 
    padding: 12px 20px 12px 45px; 
    border-radius: 50px; 
    color: white; 
    font-family: inherit;
    font-size: 1rem;
    outline: none; 
    transition: 0.3s; 
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}
.search-bar input:focus { border-color: var(--primary); background: rgba(255,255,255,0.05); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.search-bar i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: 220px; /* Base height for 1x1 cell */
    gap: 1.5rem;
    grid-auto-flow: dense; /* Fill holes automatically */
    padding-bottom: 4rem;
}

/* Theme Colors by Category */
.cat-ai { --theme: #a855f7; --theme-alpha: rgba(168, 85, 247, 0.2); }
.cat-post { --theme: #3b82f6; --theme-alpha: rgba(59, 130, 246, 0.2); }
.cat-prod { --theme: #f59e0b; --theme-alpha: rgba(245, 158, 11, 0.2); }
.cat-set { --theme: #10b981; --theme-alpha: rgba(16, 185, 129, 0.2); }
.cat-design { --theme: #ec4899; --theme-alpha: rgba(236, 72, 153, 0.2); }
.cat-utils { --theme: #0ea5e9; --theme-alpha: rgba(14, 165, 233, 0.2); }
.cat-dev { --theme: #ef4444; --theme-alpha: rgba(239, 68, 68, 0.2); }

/* Premium Focus Effect: Blur siblings when hovering or focusing over the grid */
.bento-grid:hover .bento-card:not(:hover),
.bento-grid:focus-within .bento-card:not(:focus-visible) {
    filter: blur(2px) brightness(0.7);
    transform: scale(0.98);
    opacity: 0.8;
}

/* Card Styles */
.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: white;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.4s ease, opacity 0.4s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transform: translateY(0) scale(1);
    outline: none; /* Removed default outline for custom focus */
}

.bento-card:hover,
.bento-card:focus-visible {
    transform: translateY(-10px) scale(1.08); /* Card and text appear larger */
    border-color: var(--theme, var(--primary));
    background: var(--card-hover);
    box-shadow: 0 35px 60px rgba(0,0,0,0.8), 0 0 40px var(--theme-alpha, rgba(59, 130, 246, 0.25));
    z-index: 10;
}

/* Sizing Modifiers */
.bento-default { grid-column: span 1; grid-row: span 1; }
.bento-wide, .bento-special { grid-column: span 2; grid-row: span 1; }
.bento-large { grid-column: span 2; grid-row: span 2; }

/* Responsive adjustments for Bento */
@media (max-width: 1400px) {
    .bento-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 1100px) {
    .bento-wide, .bento-large, .bento-special { grid-column: span 1; }
    .bento-large, .bento-special { grid-row: span 1; }
}

/* Card Internal Layout */
.bento-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.bento-icon {
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--theme, var(--primary));
    transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.bento-card:hover .bento-icon,
.bento-card:focus-visible .bento-icon {
    background: var(--theme, var(--primary));
    color: white;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 5px 15px var(--theme-alpha, rgba(59, 130, 246, 0.4));
}

.bento-body { flex: 1; padding-bottom: 2rem; }
.bento-body h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.5px; }
.bento-body p { 
    font-size: 0.85rem; 
    color: var(--text-dim); 
    line-height: 1.4; 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    transition: color 0.3s;
}
.bento-card:hover .bento-body p,
.bento-card:focus-visible .bento-body p {
    -webkit-line-clamp: 10; /* Reveals the full text */
    color: rgba(255, 255, 255, 0.9);
}

.bento-footer {
    display: flex; justify-content: space-between; align-items: center;
    position: absolute;
    bottom: 1.2rem;
    left: 1.2rem;
    right: 1.2rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.launch-text { font-size: 0.75rem; font-weight: 700; color: var(--primary); opacity: 0; transform: translateX(-10px); transition: 0.3s; }
.bento-card:hover .launch-text,
.bento-card:focus-visible .launch-text { opacity: 1; transform: translateX(0); }

/* Badges & Fav */
.bento-badge { font-size: 0.55rem; font-weight: 800; padding: 4px 8px; border-radius: 6px; letter-spacing: 0.5px; }
.bento-badge.hot { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.bento-badge.dev { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }

.bento-fav { color: var(--text-dim); cursor: pointer; font-size: 1rem; transition: 0.2s; z-index: 10; }
.bento-fav:hover { transform: scale(1.2); }
.bento-fav.active { color: #f59e0b; text-shadow: 0 0 10px rgba(245,158,11,0.5); }

/* Special Hero Card */
.bento-special {
    background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(59,130,246,0.1));
    border: 1px solid rgba(168,85,247,0.4);
    justify-content: center;
    padding: 1.2rem 1.5rem;
}
.bento-glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 0%, rgba(168,85,247,0.2), transparent 70%); }
.bento-special-content { position: relative; z-index: 2; display: flex; flex-direction: row; gap: 1.2rem; align-items: center; }
.bento-icon-lg { width: 55px; height: 55px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; box-shadow: 0 10px 20px rgba(168,85,247,0.4); margin-bottom: 0; }

/* Profile Mini & Hover Card */
.profile-wrapper { position: relative; cursor: pointer; }
.profile-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; transition: border-color 0.3s; display: block; }
.profile-wrapper:hover .profile-avatar { border-color: var(--primary); }

.contact-card {
    position: absolute; top: calc(100% + 14px); right: 0;
    width: 260px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 1.2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 0 0.5px rgba(255,255,255,0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 200;
}
.profile-wrapper:hover .contact-card { opacity: 1; visibility: visible; transform: translateY(0); }
.contact-card::before {
    content: ''; position: absolute; top: -6px; right: 14px;
    width: 12px; height: 12px;
    background: rgba(10,10,15,0.85);
    border-left: 1px solid rgba(255,255,255,0.1);
    border-top: 1px solid rgba(255,255,255,0.1);
    transform: rotate(45deg);
}
.contact-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
.contact-card-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); flex-shrink: 0; }
.contact-card-name { font-weight: 700; font-size: 0.9rem; }
.contact-card-title { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }
.contact-links { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; text-decoration: none; color: var(--text-dim); font-size: 0.78rem; font-weight: 600; transition: background 0.2s, color 0.2s; }
.contact-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.contact-link i { width: 16px; text-align: center; font-size: 0.85rem; }
.contact-link.email i { color: #3b82f6; }
.contact-link.whatsapp i { color: #25D366; }
.contact-link.linkedin i { color: #0A66C2; }
.contact-link.web i { color: #a78bfa; }

/* Mobile Menu Elements */
.hamburger-btn { display: none; background: rgba(255,255,255,0.05); border: 1px solid var(--border); width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center; cursor: pointer; color: white; transition: 0.3s; }
.hamburger-btn:hover { background: rgba(255,255,255,0.1); }
.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99; backdrop-filter: blur(2px); }
.nav-overlay.active { display: block; }

@media (max-width: 992px) {
    .hamburger-btn { display: flex; }
    .sidebar { position: fixed; left: -100%; top: 0; bottom: 0; transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 100; }
    .sidebar.active { left: 0; }
    .search-bar { width: 200px; }
    .main-content { padding: 1.5rem; }
}
