/* Bootstrap 5 theme integration - prevent FOUC */
:root {
    color-scheme: light dark;
}

/* Ensure proper color-scheme per theme */
[data-bs-theme="light"] {
    color-scheme: light;
}

[data-bs-theme="dark"] {
    color-scheme: dark;
}

/* Fast theme transition for all elements */
* {
    transition: background-color 0.15s ease, 
                border-color 0.15s ease, 
                color 0.15s ease;
}

/* CSS Variables - Extend Bootstrap's system */
:root {
    --primary-color: var(--bs-primary);
    --primary-hover: var(--bs-primary-hover, #0b5ed7);
    --text-primary: var(--bs-body-color);
    --text-muted: var(--bs-secondary-color);
    --link-color: var(--bs-link-color);
    --border-color: var(--bs-border-color);
    --bg-light: var(--bs-secondary-bg);
}

/* Prevent white flash by respecting system preference immediately */
@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme]) {
        color-scheme: dark;
        --bs-body-color: #ffffff;
        --bs-body-bg: #212529;
        --bs-secondary-bg: #343a40;
        --bs-tertiary-bg: #2b3035;
        --bs-border-color: #495057;
        --bs-link-color: #6ea8fe;
        --bs-primary: #0d6efd;
    }
    
    :root:not([data-bs-theme]) body {
        background-color: var(--bs-body-bg);
        color: var(--bs-body-color);
    }
    
    :root:not([data-bs-theme]) .navbar-dark {
        background-color: #1a1a1a !important;
    }
    
    :root:not([data-bs-theme]) .card {
        background-color: var(--bs-secondary-bg);
        border-color: var(--bs-border-color);
        color: var(--bs-body-color);
    }
    
    :root:not([data-bs-theme]) .form-control {
        background-color: var(--bs-secondary-bg);
        border-color: var(--bs-border-color);
        color: var(--bs-body-color);
    }
}

/* Dark mode variables - Use Bootstrap's CSS custom properties */
[data-bs-theme="dark"] {
    --primary-color: var(--bs-primary);
    --primary-hover: var(--bs-primary-hover, #0b5ed7);
    --text-primary: var(--bs-body-color);
    --text-muted: var(--bs-secondary-color);
    --link-color: var(--bs-link-color);
    --border-color: var(--bs-border-color);
    --bg-light: var(--bs-secondary-bg);
}

/* Dark mode specific styles */
[data-bs-theme="dark"] .card {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .navbar-dark {
    background-color: #1a1a1a !important;
}

[data-bs-theme="dark"] .share-panel {
    background: var(--bs-secondary-bg);
    color: #ffffff;
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .form-control {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: #ffffff;
}

[data-bs-theme="dark"] .form-select {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: #ffffff;
}

[data-bs-theme="dark"] .btn-group .btn {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: #ffffff;
}

[data-bs-theme="dark"] .btn-group .btn:hover:not(.active) {
    background-color: var(--bs-gray-700);
    color: #ffffff !important;
}

[data-bs-theme="dark"] .category-badge {
    background-color: var(--bs-gray-700);
    color: #ffffff;
}

[data-bs-theme="dark"] #screenshotsCarousel {
    background-color: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .installation-guide .detailed-steps > li::before {
    background-color: var(--primary-color);
}

[data-bs-theme="dark"] .device-compatibility {
    background: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .app-stats .stat-card {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .related-apps-container .row::-webkit-scrollbar-track {
    background: var(--bs-gray-700);
}

[data-bs-theme="dark"] .related-apps-container .row::-webkit-scrollbar-thumb {
    background: var(--bs-gray-600);
}

[data-bs-theme="dark"] .related-apps-container .row::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

[data-bs-theme="dark"] .scroll-dot {
    background-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .scroll-dot.active {
    background-color: rgba(255, 255, 255, 0.5);
}

[data-bs-theme="dark"] .features-preview {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Base styles */
body {
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
}

/* Heading styles */
h1 {
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem; /* Reduced from default 2rem to 1.5rem */
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
        padding: 0.5rem 0;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
}

/* Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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


.app-icon {
    width: 100%;
    height: 200px;
    object-fit: cover;
    padding: 20px;
    animation: fadeIn 0.3s ease-in-out;
    transition: all 0.3s ease;
}

.app-icon:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.app-icon.lazy-image.loaded:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* App detail page main icon */
.app-detail-icon {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border-radius: 20px !important;
}

.app-detail-icon:hover {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
    filter: brightness(1.1) saturate(1.2);
}

.app-detail-icon.lazy-image.loaded:hover {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
    filter: brightness(1.1) saturate(1.2);
}

/* General image hover effects */
img {
    transition: all 0.2s ease;
}

img:hover {
    filter: brightness(1.05);
}

/* Specific hover effects for clickable images */
a img:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.card {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                background-color 0.15s ease,
                border-color 0.15s ease,
                color 0.15s ease;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease-in-out;
    transform: translateY(0) scale(1);
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.navbar {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.navbar-brand {
    transition: all 0.2s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.navbar-brand i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.navbar-brand:hover i {
    transform: rotate(10deg);
    color: #ffd700;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-title a {
    color: var(--bs-body-color);
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--bs-link-color);
}

.card-text.text-muted {
    font-size: 0.8rem;
}

.btn {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(0);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn i {
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.btn:hover i {
    transform: scale(1.1);
}

.btn-primary {
    background-color: var(--bs-primary);
    border: none;
    padding: 0.5rem 1rem;
    animation: fadeIn 0.3s ease-in-out;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--bs-primary-hover, #0b5ed7);
    box-shadow: 0 6px 16px rgba(var(--bs-primary-rgb), 0.4);
}

.btn-outline-primary {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-outline-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0,123,255,0.2);
}

.btn-outline-secondary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(108,117,125,0.2);
}

/* Featured apps in categories */
.featured-app {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.featured-icon:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.featured-icon.lazy-image.loaded:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.featured-app a {
    color: var(--bs-body-color);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    transition: all 0.2s ease;
    text-decoration: none;
}

.featured-app a:hover {
    color: var(--bs-link-color);
    transform: translateX(3px);
}

/* General link hover effects */
a {
    transition: all 0.2s ease;
}

a:hover {
    text-decoration: none;
}

/* Floating Social Share */
.floating-social-share {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.share-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6)) !important;
    backdrop-filter: blur(10px);
    color: #333333;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 
                0 2px 8px rgba(0, 0, 0, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-toggle:hover {
    transform: translateY(-2px) scale(1.1);
    border-color: rgba(0, 0, 0, 0.25) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7)) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 
                0 4px 12px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 1);
    color: #222222;
}

.share-toggle:active {
    transform: translateY(-1px) scale(1.05);
    transition: all 0.1s ease;
}

/* Dark theme styling for share toggle on desktop */
[data-bs-theme="dark"] .share-toggle {
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.6), rgba(108, 117, 125, 0.4)) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 
                0 2px 8px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

[data-bs-theme="dark"] .share-toggle:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.8), rgba(108, 117, 125, 0.6)) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 
                0 4px 12px rgba(0, 0, 0, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.share-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6)) !important;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 0, 0, 0.15) !important;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 
                0 4px 12px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: none;
    flex-direction: column;
    gap: 15px;
}

/* Dark theme styling for desktop share panel */
[data-bs-theme="dark"] .share-panel {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.6), rgba(108, 117, 125, 0.4)) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 
                0 4px 12px rgba(0, 0, 0, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.floating-social-share.active .share-panel {
    display: flex;
}

.share-panel a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    font-size: 1.3rem;
}

.share-panel a:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.share-twitter {
    background-color: #1DA1F2;
}

.share-facebook {
    background-color: #4267B2;
}

.share-whatsapp {
    background-color: #25D366;
}

.share-telegram {
    background-color: #0088cc;
}


/* Compatibility badges */
.compatibility-info .badge {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-weight: normal;
}

.compatibility-info .badge i {
    margin-right: 0.35rem;
}

/* Download button styles */
.btn-success .download-count {
    font-size: 0.9rem;
    opacity: 0.9;
}

.btn-success .download-count i {
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

/* Update existing download count styles */
.download-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Controls styles */
.form-control {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Inline clear button in search */
.search-clear-btn {
    opacity: 0.6;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-btn:hover {
    opacity: 1;
    color: #dc3545 !important;
    transform: scale(1.1);
}

.form-control:hover {
    border-color: var(--bs-primary-border-subtle);
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
    border-color: var(--bs-primary-border-subtle);
    transform: translateY(-1px);
}

.btn-group {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-group .btn {
    padding: 0.375rem 0.75rem;
    border-color: var(--bs-border-color);
}

.btn-group .btn.active {
    background-color: var(--bs-primary);
    color: var(--bs-white);
    border-color: var(--bs-primary);
}

.btn-group .btn:hover:not(.active) {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color) !important;
}

.pagination {
    margin-bottom: 0;
}

.page-link {
    padding: 0.5rem 0.75rem;
    color: var(--bs-link-color);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: scale(1);
}

.page-link:hover {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
    color: var(--bs-link-hover-color);
}

.page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.form-select {
    cursor: pointer;
    border-color: var(--bs-border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.form-select:hover {
    border-color: var(--bs-primary-border-subtle);
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
    transform: translateY(-1px);
}

.form-select:focus {
    border-color: var(--bs-primary-border-subtle);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
    transform: translateY(-1px);
}

/* Badge animations */
.badge {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: scale(1);
    cursor: pointer;
}

.badge:hover {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Specific badge hover colors */
.badge.bg-primary:hover {
    box-shadow: 0 4px 8px rgba(0,123,255,0.4);
}

.badge.bg-success:hover {
    box-shadow: 0 4px 8px rgba(25,135,84,0.4);
}

.badge.bg-info:hover {
    box-shadow: 0 4px 8px rgba(13,202,240,0.4);
}

.badge.bg-secondary:hover {
    box-shadow: 0 4px 8px rgba(108,117,125,0.4);
}

/* Category badge */
.category-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.category-badge:hover {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 4px 8px rgba(108,117,125,0.3);
}

/* Screenshots gallery */
.screenshots-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.screenshot-item {
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.screenshot-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.screenshot-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-group {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .btn-group .btn {
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0.375rem;
        font-size: 0.9rem;
    }
    
    .form-select {
        margin-bottom: 1rem;
    }

    .controls-row {
        flex-direction: column;
    }

    .controls-row > div {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    .floating-social-share {
        right: 20px;
        bottom: 20px;
    }

    .share-toggle {
        width: 50px;
        height: 50px;
        border-radius: 50% !important;
        border: 2px solid rgba(0, 0, 0, 0.15) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6)) !important;
        backdrop-filter: blur(10px);
        font-size: 18px;
        color: #333333;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 
                    0 2px 8px rgba(0, 0, 0, 0.1),
                    inset 0 1px 0 rgba(255, 255, 255, 0.8);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .share-toggle:hover {
        transform: translateY(-2px) scale(1.05);
        border-color: rgba(0, 0, 0, 0.25) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7)) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 
                    0 4px 12px rgba(0, 0, 0, 0.15),
                    inset 0 1px 0 rgba(255, 255, 255, 1);
        color: #222222;
    }
    
    .share-toggle:active {
        transform: translateY(-1px) scale(1.02);
        transition: all 0.1s ease;
    }
    
    /* Dark theme styling for share toggle */
    [data-bs-theme="dark"] .share-toggle {
        border-color: rgba(255, 255, 255, 0.2) !important;
        background: linear-gradient(135deg, rgba(108, 117, 125, 0.6), rgba(108, 117, 125, 0.4)) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 
                    0 2px 8px rgba(0, 0, 0, 0.2),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }
    
    [data-bs-theme="dark"] .share-toggle:hover {
        border-color: rgba(255, 255, 255, 0.3) !important;
        background: linear-gradient(135deg, rgba(108, 117, 125, 0.8), rgba(108, 117, 125, 0.6)) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 
                    0 4px 12px rgba(0, 0, 0, 0.25),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
        color: #ffffff;
    }

    .share-panel {
        bottom: 60px;
        padding: 12px;
        border-radius: 20px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6)) !important;
        backdrop-filter: blur(10px);
        border: 2px solid rgba(0, 0, 0, 0.15) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 
                    0 4px 12px rgba(0, 0, 0, 0.1),
                    inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    
    /* Dark theme styling for share panel */
    [data-bs-theme="dark"] .share-panel {
        background: linear-gradient(135deg, rgba(108, 117, 125, 0.6), rgba(108, 117, 125, 0.4)) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 
                    0 4px 12px rgba(0, 0, 0, 0.25),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    .share-panel a {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .screenshots-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .card-title {
        font-size: 1rem;
    }

    .featured-app a {
        font-size: 0.8rem;
    }
    
    /* Mobile pagination improvements */
    .pagination-sm .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        min-width: 40px;
        text-align: center;
    }
    
    .results-section h1.h4 {
        font-size: 1.3rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    .results-section .text-muted {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* Single column layout for mobile - much cleaner approach */
    /* Only apply to app grid, not stat cards */
    #app-grid .col-6,
    #skeleton-container .col-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Keep stat cards as 2-column on mobile */
    .app-stats .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    /* Eliminate all unnecessary mobile spacing */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    /* Remove Bootstrap row negative margins */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Remove column padding only for app grid */
    #app-grid .col-6,
    #app-grid .col-md-4,
    #app-grid .col-lg-3,
    #skeleton-container .col-6,
    #skeleton-container .col-md-4,
    #skeleton-container .col-lg-3 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Add proper spacing only between app cards */
    #app-grid .col-6 .card,
    #skeleton-container .col-6 .card {
        margin-bottom: 1rem;
    }
    
    /* Fix nav-tabs on mobile - prevent stacking */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
        flex-shrink: 0;
        min-width: auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Installation Guide Styles */
.installation-guide .detailed-steps {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}

.installation-guide .detailed-steps > li {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1.5rem;
}

.installation-guide .detailed-steps > li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    width: 1.8rem;
    height: 1.8rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.installation-guide .detailed-steps ul {
    padding-left: 1.2rem;
    margin-top: 0.5rem;
}

.installation-guide .alert {
    border-left: 4px solid;
}

.installation-guide .alert-info {
    border-left-color: #0dcaf0;
}

.installation-guide .alert-warning {
    border-left-color: #ffc107;
}

.installation-guide .alert h5 {
    color: inherit;
    margin-bottom: 1rem;
}

.installation-guide .alert h5 i {
    margin-right: 0.5rem;
}

/* App Information Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--bs-border-color);
}

.nav-tabs .nav-link {
    margin-bottom: -2px;
    border: none;
    color: var(--bs-body-color);
    padding: 0.75rem 1.25rem;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: var(--bs-link-color);
}

.nav-tabs .nav-link.active {
    color: var(--bs-link-color);
    background-color: transparent;
    border-bottom: 2px solid var(--bs-link-color);
}

.nav-tabs .nav-link i {
    margin-right: 0.5rem;
}

/* Screenshots Carousel */
#screenshotsCarousel {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

#screenshotsCarousel .carousel-inner {
    max-height: 600px;
    background: #000;
}

#screenshotsCarousel .carousel-item {
    text-align: center;
    background-color: transparent;
    position: relative;
    padding: 40px 0;
}

#screenshotsCarousel .screenshot-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.3);
    transform: scale(1.1);
    z-index: 0;
}

#screenshotsCarousel .carousel-item::before {
    display: none;
}

/* Add smooth transitions */
#screenshotsCarousel .carousel-item {
    transition: transform 0.6s ease-in-out;
}

#screenshotsCarousel .screenshot-background {
    transition: all 0.6s ease-in-out;
}

#screenshotsCarousel .carousel-item.active .screenshot-background {
    filter: blur(10px) brightness(0.3);
}

#screenshotsCarousel .carousel-item:not(.active) .screenshot-background {
    filter: blur(15px) brightness(0.1);
}

#screenshotsCarousel .carousel-item img {
    max-height: 600px;
    width: auto;
    margin: 0 auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 8px;
}

#screenshotsCarousel .carousel-control-prev,
#screenshotsCarousel .carousel-control-next {
    width: 10%;
    z-index: 2;
    background: none;
}

#screenshotsCarousel .carousel-control-prev-icon,
#screenshotsCarousel .carousel-control-next-icon {
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    padding: 20px;
}

#screenshotsCarousel .carousel-indicators {
    margin-bottom: 0;
    z-index: 2;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    padding: 5px 10px;
    margin: 0 auto 10px;
    width: auto;
    left: 50%;
    transform: translateX(-50%);
}

#screenshotsCarousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 4px;
    background-color: rgba(255,255,255,0.5);
    border: 2px solid rgba(255,255,255,0.8);
}

#screenshotsCarousel .carousel-indicators button.active {
    background-color: #fff;
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
    #screenshotsCarousel .carousel-inner {
        max-height: 400px;
    }
    
    #screenshotsCarousel .carousel-item {
        padding: 20px 0;
    }
    
    #screenshotsCarousel .carousel-item img {
        max-height: 400px;
    }
    
    #screenshotsCarousel .carousel-control-prev-icon,
    #screenshotsCarousel .carousel-control-next-icon {
        padding: 15px;
    }
}

/* Hack Features Styles */
.feature-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    columns: 2;
    column-gap: 2rem;
}

.feature-list li {
    margin-bottom: 0.75rem;
    break-inside: avoid;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideUp 0.3s ease-in-out;
    animation-fill-mode: both;
}

.feature-list li:nth-child(n) {
    animation-delay: calc(0.1s * var(--animation-order, 0));
}

.feature-list li i {
    flex-shrink: 0;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .feature-list {
        columns: 1;
    }
}

/* Device Compatibility */
.device-compatibility {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    background: rgba(108, 117, 125, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.device-compatibility i {
    font-size: 0.9rem;
    color: #6c757d;
    transition: color 0.2s;
}

.device-compatibility i:hover {
    color: #495057;
}

/* App Statistics */
.app-stats .stat-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-in-out;
    transform: translateY(0) scale(1);
}

.app-stats .stat-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.app-stats .stat-icon {
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.app-stats .stat-card:hover .stat-icon i {
    transform: scale(1.2);
    filter: brightness(1.2);
}

.app-stats .stat-value {
    font-size: 1.1rem;
    line-height: 1.2;
}

.app-stats .stat-label {
    color: #6c757d;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .app-stats .stat-icon {
        font-size: 1rem;
    }
    
    .app-stats .stat-value {
        font-size: 0.9rem;
    }
    
    .app-stats .stat-label {
        font-size: 0.75rem;
    }
}

/* Related Apps Horizontal Scroll */
.related-apps-container {
    position: relative;
    margin: 0 -15px;
    padding: 0 15px;
}

.related-apps-container .row {
    overflow-x: auto;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    scroll-behavior: auto; /* Default to instant scrolling */
    padding-bottom: 20px;
    margin-right: -15px;
}

/* Enable smooth scrolling only for touch devices */
@media (hover: none) and (pointer: coarse) {
    .related-apps-container .row {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

.related-apps-container .row::-webkit-scrollbar {
    height: 6px;
}

.related-apps-container .row::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.related-apps-container .row::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.related-apps-container .row::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.related-apps-container .card {
    margin-right: 15px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                background-color 0.15s ease,
                border-color 0.15s ease,
                color 0.15s ease;
}

.related-apps-container .card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Scroll Indicators */
.scroll-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    pointer-events: none; /* Make dots non-interactive */
}

.scroll-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.scroll-dot.active {
    background-color: rgba(0, 0, 0, 0.5);
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .related-apps-container {
        margin: 0 -10px;
        padding: 0 10px;
    }
    
    .related-apps-container .card {
        margin-right: 10px;
        margin-bottom: 10px;
    }

    .related-apps-container .row {
        margin-right: 0;
    }

    .related-apps-container .col-12 {
        padding-right: 5px;
        padding-left: 5px;
    }

    .related-apps-container .row::-webkit-scrollbar {
        display: none;
    }
}

/* Features Preview in Related Apps */
.features-preview {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 0.5rem;
}

.features-preview ul li {
    margin-bottom: 0.25rem;
    line-height: 1.2;
    display: flex;
    align-items: start;
    gap: 0.35rem;
}

.features-preview ul li i {
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.features-preview .card-text i {
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

@media (max-width: 768px) {
    .related-apps-container {
        margin: 0 -10px;
        padding: 0 10px;
    }
}


/* CLS-optimized lazy loading images */
.lazy-image {
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
    /* Improved placeholder background */
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%),
                linear-gradient(-45deg, #f8f9fa 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f8f9fa 75%),
                linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #f8f9fa;
}

/* App grid lazy images - fixed height for CLS optimization */
.app-icon.lazy-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* App detail page icon - maintain natural dimensions */
.app-detail-icon.lazy-image {
    max-width: 100%;
    height: auto;
}

[data-bs-theme="dark"] .lazy-image {
    background: linear-gradient(45deg, #0f1114 25%, transparent 25%),
                linear-gradient(-45deg, #0f1114 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #0f1114 75%),
                linear-gradient(-45deg, transparent 75%, #0f1114 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #1a1d20;
}

.lazy-image.loaded {
    opacity: 1;
    background: none;
}

.lazy-image.loading {
    opacity: 0.7;
    filter: blur(1px);
}

/* Breadcrumb styles */
.breadcrumb-item a {
    text-decoration: none;
    color: var(--bs-body-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.breadcrumb-item a:hover {
    text-decoration: none;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-link-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.breadcrumb-item a i {
    transition: transform 0.2s ease;
}

.breadcrumb-item a:hover i {
    transform: scale(1.1);
}

/* =============================================================================
   THEME TOGGLE COMPONENT STYLES
   ============================================================================= */

.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    position: relative;
    width: 42px;
    height: 38px;
    border-radius: 20px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05)) !important;
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.theme-toggle-btn:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1)) !important;
}

.theme-toggle-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.theme-toggle-btn:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.theme-icon-container {
    position: relative;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-icon {
    position: absolute;
    font-size: 16px;
    color: #ffffff;
    transform-origin: center;
    margin: 0 !important;
}

.light-icon {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.6));
}

.dark-icon {
    opacity: 0;
    filter: drop-shadow(0 0 8px rgba(108, 117, 125, 0.6));
}

/* Dark theme icon states */
[data-bs-theme="dark"] .light-icon {
    opacity: 0;
    filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.2));
}

[data-bs-theme="dark"] .dark-icon {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(108, 117, 125, 0.8));
}

/* Dark theme button styling */
[data-bs-theme="dark"] .theme-toggle-btn {
    border-color: rgba(108, 117, 125, 0.3) !important;
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.05)) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .theme-toggle-btn:hover {
    border-color: rgba(108, 117, 125, 0.5) !important;
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.2), rgba(108, 117, 125, 0.1)) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .theme-toggle-btn:focus {
    border-color: rgba(108, 117, 125, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.1), 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-toggle {
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 1000;
        margin: 0 !important;
    }
    
    .theme-toggle-btn {
        width: 50px;
        height: 50px;
        border-radius: 50% !important;
        border: 2px solid rgba(0, 0, 0, 0.15) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6)) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 
                    0 2px 8px rgba(0, 0, 0, 0.1),
                    inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    
    .theme-toggle-btn:hover {
        border-color: rgba(0, 0, 0, 0.25) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7)) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 
                    0 4px 12px rgba(0, 0, 0, 0.15),
                    inset 0 1px 0 rgba(255, 255, 255, 1);
    }
    
    .theme-icon {
        font-size: 18px;
        color: #333333;
    }
    
    .light-icon {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.6));
        color: #333333;
    }
    
    .dark-icon {
        opacity: 0;
        filter: drop-shadow(0 0 8px rgba(108, 117, 125, 0.6));
        color: #333333;
    }
    
    .theme-icon-container {
        width: 20px;
        height: 20px;
    }
    
    /* Dark theme mobile adjustments */
    [data-bs-theme="dark"] .theme-toggle-btn {
        border-color: rgba(255, 255, 255, 0.2) !important;
        background: linear-gradient(135deg, rgba(108, 117, 125, 0.6), rgba(108, 117, 125, 0.4)) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 
                    0 2px 8px rgba(0, 0, 0, 0.2),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    
    [data-bs-theme="dark"] .theme-toggle-btn:hover {
        border-color: rgba(255, 255, 255, 0.3) !important;
        background: linear-gradient(135deg, rgba(108, 117, 125, 0.8), rgba(108, 117, 125, 0.6)) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 
                    0 4px 12px rgba(0, 0, 0, 0.25),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    
    [data-bs-theme="dark"] .theme-icon {
        color: #ffffff;
    }
    
    [data-bs-theme="dark"] .light-icon {
        opacity: 0;
        filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.2));
        color: #ffffff;
    }
    
    [data-bs-theme="dark"] .dark-icon {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(108, 117, 125, 0.8));
        color: #ffffff;
    }
} 