/* Import Google Sans Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #10b981;
    --dark-bg: #1f2937;
    --light-bg: #f3f4f6;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar - Light Mode */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

::-webkit-scrollbar-corner {
    background: var(--light-bg);
}

/* Dark Mode Variables */
body.dark-mode {
    --light-bg: #111827;
    --dark-bg: #ffffff;
    --text-color: #f9fafb;
    --text-muted: #9ca3af;
    --card-bg: #1f2937;
    --border-color: #374151;
}

/* Custom Scrollbar - Dark Mode */
body.dark-mode ::-webkit-scrollbar-track {
    background: #0f172a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

body.dark-mode ::-webkit-scrollbar-corner {
    background: #0f172a;
}

body.dark-mode .top-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

body.dark-mode .main-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .hero-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

body.dark-mode .footer {
    background: #0f172a;
}

/* Header Styles */
.top-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.site-logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-logo i {
    font-weight: normal;
}

.site-logo:hover {
    color: white;
    opacity: 0.9;
}

/* ========== TEMPORARY CHRISTMAS TREE - REMOVE AFTER CHRISTMAS ========== */
.christmas-tree-container {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
}

.christmas-tree-container svg {
    height: 40px;
    width: auto;
    overflow: visible;
    animation: treeGlow 2s ease-in-out infinite alternate;
}

.christmas-tree-container svg path {
    fill: #ffffff !important;
    stroke: #ffffff !important;
    stroke-width: .2;
    transform: scale(0);
    transform-origin: 50% 50%;
    animation: star 8s ease-in-out infinite;
    animation-delay: calc(var(--no) * .025s);
    animation-fill-mode: backwards;
    transform-box: fill-box;
    opacity: 0;
}

.christmas-tree-container svg path[style*="fill:#d8e540"] {
    fill: #fffacd !important;
    stroke: #fffacd !important;
}

@keyframes star {
    0% {
        transform: scale(0);
        opacity: 0;
        animation-timing-function: cubic-bezier(.74,1.72,.57,1.01)
    }
    10% {
        transform: scale(1);
        opacity: 1;
    }
    65% {
        transform: translateY(0px) scale(1);
        opacity: 1;
    }
    75% {
        transform: translateY(50px) scale(0);
        opacity: 0;
    }
    100% {
        transform: translateY(0px) scale(0);
        opacity: 0;
    }
}

@keyframes treeGlow {
    0% {
        filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    }
}

/* Dark mode Christmas tree */
body.dark-mode .christmas-tree-container svg {
    filter: brightness(1.2);
}

/* Responsive Christmas tree for mobile */
@media (max-width: 768px) {
    .site-logo {
        font-size: 1.5rem;
    }

    .christmas-tree-container svg {
        height: 28px;
    }
}

@media (max-width: 576px) {
    .site-logo {
        font-size: 1.3rem;
    }

    .site-logo i {
        font-size: 1.3rem;
    }

    .christmas-tree-container {
        margin-left: 0.25rem;
    }

    .christmas-tree-container svg {
        height: 22px;
    }
}

@media (max-width: 480px) {
    .site-logo {
        font-size: 1.1rem;
        gap: 0.3rem;
    }

    .site-logo i {
        font-size: 1.1rem;
    }

    .christmas-tree-container {
        margin-left: 0.2rem;
    }

    .christmas-tree-container svg {
        height: 18px;
    }
}

@media (max-width: 360px) {
    .site-logo {
        font-size: 0.95rem;
        gap: 0.25rem;
    }

    .site-logo i {
        font-size: 0.95rem;
    }

    .christmas-tree-container svg {
        height: 15px;
    }

    .top-header {
        padding: 0.75rem 0;
    }
}

@media (max-width: 320px) {
    .site-logo {
        font-size: 0.85rem;
    }

    .site-logo i {
        font-size: 0.85rem;
    }

    .christmas-tree-container svg {
        height: 12px;
    }
}
/* ========== END CHRISTMAS TREE CSS ========== */

.lang-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.4rem 1rem;
    border: 2px solid white;
    background: transparent;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.lang-btn:hover, .lang-btn.active {
    background: white;
    color: var(--primary-color);
}

/* Navigation */
.main-nav {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-link {
    color: #374151;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
    border-radius: 5px;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--light-bg);
}

body.dark-mode .nav-link {
    color: var(--text-color);
}

body.dark-mode .nav-link:hover {
    background: rgba(37, 99, 235, 0.2);
}

/* Category Section */
.category-section {
    margin: 3rem 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
}

.dark-mode-toggle:hover {
    background: white;
    color: var(--primary-color);
    transform: rotate(180deg);
}

.view-more-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.view-more-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* App Card */
.app-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

body.dark-mode .app-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

/* Dark mode for collection cards */
body.dark-mode .app-card[style*="background: linear-gradient"] {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .app-card [style*="background: white"] {
    background: rgba(0,0,0,0.3) !important;
    color: var(--text-color);
}

body.dark-mode .app-card [style*="color: var(--dark-bg)"] {
    color: var(--text-color) !important;
}

.app-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
}

.app-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.app-version {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.app-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.badge-new {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-featured {
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.app-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 8px;
}

body.dark-mode .app-meta {
    background: rgba(0,0,0,0.2);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.meta-item i {
    color: var(--primary-color);
}

.download-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    width: 100%;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
}

body.dark-mode .search-input {
    background: var(--card-bg);
    color: var(--text-color);
}

body.dark-mode .search-input::placeholder {
    color: var(--text-muted);
}

/* Dark mode - Override inline styles for collection cards */
body.dark-mode .collection-list-box {
    background: rgba(0,0,0,0.3) !important;
}

body.dark-mode .collection-title-text {
    color: var(--text-color) !important;
}

/* Collection App Links */
.collection-app-link {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.collection-app-link:hover {
    background: rgba(0,0,0,0.05);
    padding-left: 0.75rem;
}

body.dark-mode .collection-app-link {
    color: var(--text-color) !important;
}

body.dark-mode .collection-app-link:hover {
    background: rgba(255,255,255,0.1);
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: white !important;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer h5 {
    color: white !important;
}

.footer p,
.footer .text-muted {
    color: #d1d5db !important;
}

.footer .text-muted {
    opacity: 1 !important;
}

.footer a {
    color: #d1d5db !important;
}

body.dark-mode .footer {
    background: #0f172a;
    color: #f9fafb;
}

body.dark-mode .footer h5 {
    color: #f9fafb !important;
}

body.dark-mode .footer p,
body.dark-mode .footer .text-muted {
    color: #d1d5db !important;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-link {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
}

body.dark-mode .footer-link {
    color: #d1d5db;
}

body.dark-mode .footer-link:hover {
    color: #f9fafb;
}

body.dark-mode .footer .text-center p {
    color: #d1d5db !important;
}

.footer .text-center {
    text-align: center !important;
}

.footer .text-center p {
    text-align: center !important;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

body.dark-mode .social-link {
    background: rgba(255,255,255,0.1);
    color: #f9fafb;
}

body.dark-mode .social-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    background-color: var(--card-bg);
    border-color: var(--border-color);
    transition: all 0.3s;
}

.pagination .page-link:hover {
    color: var(--secondary-color);
    background-color: var(--light-bg);
    border-color: var(--border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-mode .pagination .page-link {
    color: var(--primary-color);
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-mode .pagination .page-link:hover {
    color: #3b82f6;
    background-color: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
}

body.dark-mode .pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

body.dark-mode .pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background-color: rgba(0,0,0,0.2);
    border-color: var(--border-color);
}

/* Vertical Carousel Card */
.vertical-carousel-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    position: relative;
    height: 400px;
}

.carousel-content {
    height: 100%;
    overflow: hidden;
    position: relative;
}

.scrolling-apps {
    display: flex;
    flex-direction: column;
    animation: scrollUp 30s linear infinite;
    will-change: transform;
}

.scrolling-apps:hover {
    animation-play-state: paused;
}

@keyframes scrollUp {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

.carousel-app-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.carousel-app-item:last-child {
    border-bottom: none;
}

.carousel-app-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    padding: 0.5rem;
    border-radius: 8px;
    position: relative;
}

.carousel-app-link:hover {
    background: var(--light-bg);
    transform: translateX(5px);
}

body.dark-mode .carousel-app-link:hover {
    background: rgba(37, 99, 235, 0.1);
}

.carousel-app-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-app-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.carousel-app-details {
    flex: 1;
    min-width: 0;
}

.carousel-app-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-app-version {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.carousel-badge-new {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .vertical-carousel-card {
        height: 350px;
        padding: 1rem;
    }

    .carousel-app-name {
        font-size: 0.9rem;
    }

    .carousel-app-icon {
        width: 40px;
        height: 40px;
    }
}
