.category-header-panel {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.header-content {
    flex: 1 1 320px;
    min-width: 0;
}
.header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 120px;
}
.category-header-adsense {
    flex: 0 1 320px;
    min-width: 180px;
    max-width: 340px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    margin-left: auto;
}
.adsense-header-placeholder {
    width: 100%;
    min-height: 70px;
    max-width: 320px;
    background: linear-gradient(90deg, #e0eaff 0%, #b2d6fc 100%);
    border-radius: 12px;
    border: 1.5px dashed #b2d6fc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.92;
    box-shadow: 0 2px 12px #60a5fa22;
    margin-left: 12px;
    margin-right: 0;
    transition: box-shadow 0.2s;
}
.adsense-header-placeholder:hover {
    box-shadow: 0 6px 24px #60a5fa33;
    opacity: 1;
}
@media (max-width: 900px) {
    .category-header-adsense {
        flex: 1 1 100%;
        max-width: 100%;
        margin-left: 0;
        margin-top: 12px;
        justify-content: center;
    }
    .adsense-header-placeholder {
        max-width: 100%;
        min-width: 120px;
        font-size: 1rem;
        margin-left: 0;
    }
}
.category-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
    margin-right: 6px;
    color: #2563eb;
    opacity: 0.85;
    font-size: 1.2em;
    vertical-align: middle;
}
/* Accessible Button Hover/Focus States */
.btn, .btn-primary, .btn-secondary {
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    outline: none;
}
.btn:hover, .btn:focus {
    background: #e0eaff !important;
    color: #1e293b !important;
    box-shadow: 0 0 0 3px #b2d6fc99 !important;
}
.btn-primary:hover, .btn-primary:focus {
    background: #2563eb !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px #60a5fa99 !important;
}
.btn-secondary:hover, .btn-secondary:focus {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    box-shadow: 0 0 0 3px #cbd5e199 !important;
}
/* Modal Backdrop Blur & Darken */
.modal-backdrop {
    background: rgba(36, 48, 80, 0.22) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    transition: background 0.2s, backdrop-filter 0.2s;
    z-index: 11000;
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* AdSense App Card (in app grid) */
.adsense-app-card {
    border: 2px dashed #b6d4fe !important;
    background: linear-gradient(90deg, #e0eaff 0%, #f8fafc 100%) !important;
    color: #64748b !important;
    opacity: 0.97;
    box-shadow: 0 2px 8px rgba(59,130,246,0.07);
}
.adsense-app-card .card-header {
    background: transparent !important;
    color: #64748b !important;
    box-shadow: none !important;
}
.adsense-app-card .card-header img {
    filter: grayscale(1) brightness(1.2) !important;
    border-radius: 8px !important;
}
.adsense-card-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    height: 100%;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
    opacity: 0.8;
}
.adsense-app-card .adsense-placeholder {
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.7;
    border: none;
    background: none;
    padding: 12px 0;
}
/* Sidebar AdSense Panel */
.sidebar-adsense-panel {
    width: 100%;
    min-height: 90px;
    max-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(236, 245, 255, 0.85);
    border-radius: 12px;
    margin-top: auto;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(59,130,246,0.07);
    padding: 10px 8px;
    position: relative;
    overflow: hidden;
}
.adsense-placeholder {
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.7;
    border: 2px dashed #b6d4fe;
    border-radius: 8px;
    background: linear-gradient(90deg, #e0eaff 0%, #f8fafc 100%);
    padding: 12px 0;
}
/* Unify app card and modal with sidebar/navbar theme */
.app-card {
    background: rgba(255,255,255,0.96) !important;
    border-radius: 16px !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 2px 12px rgba(59,130,246,0.07), 0 1.5px 8px #e0e7ff80 inset !important;
    color: #23266a !important;
    transition: box-shadow 0.3s, border-color 0.3s, background 0.3s !important;
}
.app-card:hover, .app-card:focus-within {
    background: #f7fbff !important;
    border-color: #7cd1ff !important;
    box-shadow: 0 10px 32px #53a6ff29, 0 2px 10px #53a6ff33 inset !important;
}
.card-header {
    background: linear-gradient(135deg, #e0eaff 30%, #b2d6fc 100%) !important;
    color: #264467 !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: inset 0 -3px 14px #f2f8ff55 !important;
}
.card-header h4 {
    color: #28377d !important;
}
.card-header img {
    border-radius: 10px !important;
    filter: drop-shadow(0 0 8px #a1cafc) !important;
}
.card-footer {
    background: transparent !important;
    border-radius: 0 0 16px 16px !important;
}

/* Modal unified with sidebar/navbar theme */
.modal {
    background: rgba(255,255,255,0.98) !important;
    border-radius: 16px !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 12px 48px 0 #3b82f655, 0 2px 10px #e0e7ff80 inset, 0 1.5px 8px #e0e7ff33 !important;
    color: #23266a !important;
    z-index: 11001 !important;
    position: relative;
    max-height: 75vh !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.modal-header {
    background: linear-gradient(135deg, #e0eaff 30%, #b2d6fc 100%) !important;
    color: #264467 !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: 0 2px 8px #b2d6fc22, inset 0 -3px 14px #f2f8ff55 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
.modal-header h3 {
    color: #28377d !important;
}
.modal-content {
    background: transparent !important;
    color: #23266a !important;
}
.modal-footer {
    background: transparent !important;
    border-radius: 0 0 16px 16px !important;
    box-shadow: 0 -2px 8px #b2d6fc22 !important;
    border-top: 1px solid #e2e8f0 !important;
}
/* Enhanced Container and Scrollbar Styles */
.container {
    padding: 12px;
    gap: 12px;
}

/* Custom scrollbar for all scrollable elements */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(115, 128, 165, 0.2);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: rgba(115, 128, 165, 0.3);
}

/* Enhanced Sidebar */
.sidebar {
    min-width: 250px;
    max-width: 400px;
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    border-right: none;
    position: relative;
    transition: width 0.1s ease-out;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Add resize handle */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
    transition: background 0.2s ease;
}

.sidebar:hover::after {
    background: rgba(115, 128, 165, 0.1);
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px;
}

/* Category List */
.category-list {
    padding: 0 12px;
    gap: 4px;
}

.category-badge {
    padding: 10px 16px;
    border-radius: 8px;
    background: transparent;
    color: #647491;
    font-size: 0.925rem;
    font-weight: 500;
    text-align: left;
    position: relative;
    transition: all 0.2s ease;
}

.category-badge::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    width: 3px;
    height: 0;
    background: #3b82f6;
    border-radius: 2px;
    transition: height 0.2s ease;
}

.category-badge:hover {
    background: rgba(59, 130, 246, 0.04);
    color: #3b82f6;
}

.category-badge:hover::before {
    height: 70%;
}

.category-badge.active {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
    font-weight: 600;
}

.category-badge.active::before {
    height: 100%;
    top: 0;
}

/* Main Content */
.main-content {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

/* Category Header Panel */
.category-header-panel {
    background: linear-gradient(90deg, #e0eaff 0%, #b2d6fc 100%);
    border-radius: 16px;
    padding: 22px 28px;
    margin-bottom: 28px;
    border: 1.5px solid #b2d6fc;
    box-shadow: 0 4px 24px #60a5fa22;
    color: #1e293b;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Recently Viewed Section */
.recently-viewed {
    border-top: 1px solid #e2e8f0;
    padding: 16px 20px;
    margin-top: auto;
}

.recently-viewed h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
