/* Professional Theme Toggle Button */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn {
    position: relative;
    width: 60px;
    height: 30px;
    background: linear-gradient(45deg, #ffd700, #ff6b35);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-toggle-btn svg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    transition: all 0.3s ease;
    color: #fff;
}

.theme-toggle-btn .sun-icon {
    left: 8px;
    opacity: 1;
}

.theme-toggle-btn .moon-icon {
    right: 8px;
    opacity: 0;
}

/* Dark mode styles */
body.dark-mode .theme-toggle-btn {
    background: linear-gradient(45deg, #2c3e50, #34495e);
}

/* Dark mode button styles */
body.dark-mode .app-card-actions {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-top: 1px solid #4a5568;
    min-height: 60px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .details-btn {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    border: 2px solid #4a5568;
    box-shadow: 0 2px 8px rgba(74, 85, 104, 0.4);
}

body.dark-mode .download-btn {
    background: linear-gradient(135deg, #38a169, #2f855a);
    border: 2px solid #38a169;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.4);
}

body.dark-mode .details-btn:hover {
    background: linear-gradient(135deg, #2d3748, #1a202c);
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.5);
}

body.dark-mode .download-btn:hover {
    background: linear-gradient(135deg, #2f855a, #276749);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.5);
}

body.dark-mode .theme-toggle-btn .sun-icon {
    opacity: 0;
    transform: translateY(-50%) rotate(180deg);
}

body.dark-mode .theme-toggle-btn .moon-icon {
    opacity: 1;
    transform: translateY(-50%) rotate(0deg);
}

/* Light mode styles */
body:not(.dark-mode) .theme-toggle-btn .sun-icon {
    opacity: 1;
    transform: translateY(-50%) rotate(0deg);
}

body:not(.dark-mode) .theme-toggle-btn .moon-icon {
    opacity: 0;
    transform: translateY(-50%) rotate(-180deg);
}

/* Responsive design for theme toggle */
@media (max-width: 768px) {
    .theme-toggle-btn {
        width: 50px;
        height: 25px;
    }
    
    .theme-toggle-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .theme-toggle-btn .sun-icon {
        left: 6px;
    }
    
    .theme-toggle-btn .moon-icon {
        right: 6px;
    }
}

/* Remove old theme switch styles */
.theme-switch,
.slider,
.theme-label {
    display: none;
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* General Styles */
html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    color: #333;
    direction: rtl;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    background-color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1.logo {
    font-size: 2rem;
    font-weight: bold;
}

h1.logo span:first-child {
    color: #ff4757;
}

h1.logo span:last-child {
    color: #2ed573;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-right: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: 600;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #ff4757;
}

/* Search Bar */
/* احترافية خانة البحث */
.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 1.5rem auto 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-container input[type="search"] {
    width: 100%;
    padding: 12px 44px 12px 16px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    outline: none;
    transition: box-shadow 0.3s, border 0.3s;
    color: #222;
}

.search-container input[type="search"]:focus {
    box-shadow: 0 4px 16px rgba(255,71,87,0.15);
    border: 1.5px solid #ff4757;
    background: #fff;
}

.search-container .search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    pointer-events: none;
    color: #bbb;
    transition: color 0.3s;
}

.search-container input[type="search"]:focus + .search-icon {
    color: #ff4757;
}

/* Filter Buttons */
.filter-nav {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background-color: #fff;
    color: #333;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.filter-btn:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.filter-btn.active {
    background-color: #ff4757;
    color: #fff;
    border-color: #ff4757;
}

/* Main Content */
main {
    flex-grow: 1; /* Allows main content to push the footer down */
    padding: 2rem 0;
}

section {
    margin-bottom: 3rem;
}

h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    color: #333;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.app-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 1;
    height: 320px; /* Increased height to accommodate buttons */
    min-height: 320px;
}

.app-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.app-card img {
    width: 100%;
    height: 120px;
    object-fit: contain; /* Change to contain to ensure logo is fully visible */
    transition: opacity 0.5s ease-in-out;
    padding: 10px;
}

img.lazy {
    opacity: 0;
    background-color: #eee;
}



.app-card-content {
    padding: 0.5rem;
    flex-grow: 1; /* This will push the button down */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.app-card h3 {
    font-size: 1rem;
    margin: 0.5rem 0;
    color: #333 !important;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.app-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.app-card-actions {
    display: flex;
    gap: 8px; /* Adds space between buttons */
    padding: 0.5rem; /* Add some padding */
    margin-top: auto;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-top: 1px solid #dee2e6;
    min-height: 60px;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
}

.details-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    border: 2px solid #6c757d;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.download-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: 2px solid #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.app-card .btn {
    flex-grow: 1; /* Make buttons share the space */
    text-align: center;
    display: block;
    color: #fff;
    padding: 0.6rem 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    min-height: 40px;
    line-height: 1.2;
    width: 100%;
    max-width: none;
}

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

.details-btn:hover {
    background: linear-gradient(135deg, #5a6268, #343a40);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.download-btn:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.app-card .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Shimmer effect for buttons */
.app-card .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.app-card .btn:hover::before {
    left: 100%;
}

/* Ensure buttons are always visible */
.app-card .btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Fix for mobile button display */
@media (max-width: 768px) {
    .app-card-actions {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        padding: 0.5rem !important;
        min-height: 60px !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .app-card .btn {
        display: block !important;
        flex-grow: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    text-align: center;
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #e74c3c, #f39c12, #2ecc71);
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-brand {
    text-align: center;
    margin-bottom: 1rem;
}

.footer-brand h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.footer-brand p {
    margin: 0.5rem 0 0 0;
    color: #95a5a6;
    font-size: 0.95rem;
    font-weight: 400;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-nav a {
    color: #bdc3c7;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.footer-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.footer-nav a:hover::before {
    left: 100%;
}

.footer-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.footer-content p {
    color: #95a5a6;
    font-size: 0.95rem;
    margin: 0;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    text-align: center;
}

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

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #3498db, #e74c3c);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.social-links a:hover::before {
    opacity: 1;
}

.social-links a:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.social-links a img {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    filter: brightness(0) invert(1);
}

.social-links a:hover img {
    transform: scale(1.2);
    filter: brightness(0) invert(1);
}

/* Footer responsive design */
@media (max-width: 768px) {
    footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        padding: 0 1rem;
        gap: 1rem;
    }
    
    .footer-brand h3 {
        font-size: 1.5rem;
    }
    
    .footer-brand p {
        font-size: 0.85rem;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .footer-nav a {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .social-links {
        gap: 0.75rem;
    }
    
    .social-links a {
        width: 40px;
        height: 40px;
    }
    
    .social-links a img {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    footer {
        padding: 1.5rem 0 1rem;
    }
    
    .footer-content {
        padding: 0 0.5rem;
    }
    
    .footer-brand h3 {
        font-size: 1.3rem;
    }
    
    .footer-brand p {
        font-size: 0.8rem;
    }
    
    .footer-nav a {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .footer-content p {
        font-size: 0.85rem;
        padding: 0.75rem 0;
    }
}

/* App Detail Page Specifics */
.app-page-main {
    padding: 2rem 0;
}

.app-details {
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.app-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
}

.app-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 15px;
}

.app-title-group h1 {
    margin: 0;
    font-size: 2.5rem;
    color: #333;
}

.app-version {
    margin: 0;
    font-size: 1rem;
    color: #777;
}

.app-description h2, .app-download-section h2 {
    font-size: 1.8rem;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 1rem;
}

.app-description p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
}

.app-download-section {
    text-align: center;
    margin-top: 2rem;
}

.download-button-large {
    display: inline-block;
    background-color: #2ed573;
    color: #fff;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.download-button-large:hover {
    background-color: #25b864;
    transform: scale(1.05);
}

.back-btn {
    background-color: #ff4757;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background-color: #e04250;
}

.hide {
    display: none;
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #ff4757;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(100px);
    z-index: 1001;
}

.back-to-top-btn.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background-color: #e04250;
}

/* --- Responsive Design --- */

/* Mobile Menu Icon */
.menu-icon {
    display: none; /* Hidden by default */
    font-size: 1.6rem;
    cursor: pointer;
    color: #333;
}

/* Tablets (up to 768px) */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }

        header {
        padding: 0.4rem 0;
    }

    h1.logo {
        font-size: 1.2rem;
    }

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-links a img {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
}

.social-links a:hover img {
    transform: scale(1.1);
}

    .filter-nav {
        display: none; /* Hide nav links by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 70px; /* Adjust based on header height */
        right: 0;
        background-color: #fff;
        width: 100%;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 1rem 0;
    }

    .filter-nav.show {
        display: flex; /* Show when active */
    }

    .filter-nav .filter-btn {
        text-align: center;
        padding: 1rem 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        border-radius: 0;
        width: 100%;
    }

    .filter-nav .filter-btn:last-child {
        border-bottom: none;
    }

    .menu-icon {
        display: block; /* Show hamburger icon */
    }

    .filter-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    h2 {
        font-size: 2rem;
    }

    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .app-header {
        flex-direction: column;
        text-align: center;
    }

    .app-title-group h1 {
        font-size: 2rem;
    }
}

/* Mobile Phones (up to 480px) */
@media (max-width: 480px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .app-card {
        height: 280px;
        min-height: 280px;
    }
    
    .app-card img {
        height: 90px;
        padding: 6px;
    }
    
    .app-card h3 {
        font-size: 0.9rem;
        margin: 0.3rem 0;
    }
    
    .app-card .btn {
        padding: 0.4rem 0.2rem;
        font-size: 0.7rem;
        border-radius: 5px;
        flex-grow: 1;
        min-height: 35px;
    }
    
    .app-card-actions {
        gap: 6px;
        padding: 0.4rem;
        min-height: 50px;
    }
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-nav {
        gap: 8px; /* Adjust gap for better spacing */
        justify-content: center; /* Center the buttons */
    }

    .filter-btn {
        padding: 6px 12px; /* Reduce padding */
        font-size: 0.8rem; /* Reduce font size */
    }

    .app-details {
        padding: 1rem;
    }

    .app-icon {
        width: 80px;
        height: 80px;
    }

    .app-title-group h1 {
        font-size: 1.5rem;
    }

    .app-description h2, .app-download-section h2 {
        font-size: 1.5rem;
    }

    .download-button-large {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .search-container {
        max-width: 95vw;
    }
    
    .search-container input[type="search"] {
        font-size: 1rem;
        padding: 10px 40px 10px 12px;
    }
    
    .search-container .search-icon {
        width: 18px;
        height: 18px;
        right: 10px;
    }
}

@media (max-width: 600px) {
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1rem;
  }
  .app-card {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    padding: 0;
    margin: 0;
    transition: box-shadow 0.18s, transform 0.18s;
    height: 300px;
    min-height: 300px;
  }
  .app-card img {
    height: 100px;
    object-fit: contain;
    border-radius: 12px 12px 0 0;
    padding: 8px;
    background: #f8f8f8;
    margin-bottom: 0.5rem;
  }
  .app-card-content {
    padding: 0.7rem 0.5rem 0.2rem 0.5rem;
    text-align: center;
  }
  .app-card h3 {
    font-size: 1.2rem;
    margin: 0.5rem 0 0.3rem 0;
    color: #ffffff !important;
  }
  .app-card p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.7rem;
  }
  .app-card-actions {
    flex-direction: row;
    gap: 8px;
    padding: 0.5rem;
    min-height: 60px;
    align-items: center;
  }
  .app-card .btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.3rem;
    border-radius: 6px;
    flex-grow: 1;
    margin: 0;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 40px;
  }
  .app-card .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }
}


@keyframes card-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(15px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.app-card {
    /* Existing styles... */
    animation: card-appear 0.4s ease-out forwards;
}

/* App Page Specific Styles */
.back-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background-color: #fff;
    color: #333;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-btn:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.app-page-main {
    background-color: #fff;
    padding: 2rem 0;
}

.app-details {
    max-width: 800px;
    margin: 0 auto;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

.app-icon {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.app-title-group h1 {
    margin: 0;
    font-size: 2.5rem;
}

.app-version {
    margin: 0;
    font-size: 1.1rem;
    color: #777;
}

.app-description h2, .app-download-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.app-description p {
    line-height: 1.8;
    font-size: 1.1rem;
}

.app-download-section {
    text-align: center;
    margin-top: 3rem;
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 10px;
}

.download-button-large {
    display: inline-block;
    background-color: #2ed573;
    color: #fff;
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.download-button-large:hover {
    background-color: #25b864;
    transform: scale(1.05);
}


/* Footer */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* Navbar Styles */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #222;
  color: #fff;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-logo {
  font-size: 1.5em;
  font-weight: bold;
}

.navbar-logo span:first-child {
  background: linear-gradient(to left, #ffb347, #ff4500);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.navbar-logo span:last-child {
  background: linear-gradient(to left, #00d1ff, #007bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.navbar-links {
  display: flex;
  list-style: none;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.navbar-links li a {
  color: #fff;
  text-decoration: none;
  font-size: 1em;
  transition: color 0.2s;
  padding: 8px 16px;
  border-radius: 20px;
  background: transparent;
  transition: all 0.3s ease;
}

.navbar-links li a:hover {
  color: #ffd700;
  background: rgba(255, 255, 255, 0.1);
}

.navbar-links li a.active {
  background: #ff4757;
  color: #fff;
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.navbar-toggle span {
  width: 25px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  display: block;
}

@media (max-width: 768px) {
  .navbar-links {
    display: none;
    position: absolute;
    top: 60px;
    right: 16px;
    background: #222;
    flex-direction: column;
    width: 85vw;
    max-width: 260px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 12px 0;
    z-index: 2000;
    transition: opacity 0.18s cubic-bezier(.4,0,.2,1), transform 0.18s cubic-bezier(.4,0,.2,1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
  }
  .navbar-links.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
  .navbar-toggle {
    display: flex;
    z-index: 2100;
  }
  .navbar-links li a {
    display: block;
    padding: 16px 0;
    border-radius: 0;
    text-align: center;
    margin: 0 12px;
    font-size: 1.1rem;
    background: none;
    border-bottom: 1px solid #333;
    transition: background 0.18s, color 0.18s;
  }
  .navbar-links li:last-child a {
    border-bottom: none;
  }
  .navbar-links li a:hover,
  .navbar-links li a.active {
    background: #ff4757;
    color: #fff;
  }
  .navbar {
    position: relative;
    justify-content: space-between;
  }
}

/* إخفاء أماكن الإعلانات مؤقتاً في صفحة التطبيقات */
.ad-container {
    display: none !important;
}

/* Logo styles for apps page */
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 700;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.navbar-logo:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.navbar-logo img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.navbar-logo .logo-text {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
    line-height: 1;
}

.navbar-logo .logo-text span:first-child {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 50%, #1abc9c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.6rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    letter-spacing: -0.5px;
    order: 1;
}

.navbar-logo .logo-text span:last-child {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 50%, #f39c12 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    order: 2;
}

/* Responsive logo for apps page */
@media (max-width: 768px) {
    .navbar-logo img {
        width: 28px;
        height: 28px;
    }
    
    .navbar-logo .logo-text span:first-child {
        font-size: 1.3rem;
    }
    
    .navbar-logo .logo-text span:last-child {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar-logo .logo-text {
        display: flex;
        flex-direction: row;
        gap: 4px;
        align-items: baseline;
    }
    
    .navbar-logo .logo-text span:first-child {
        font-size: 1.1rem;
    }
    
    .navbar-logo .logo-text span:last-child {
        font-size: 0.9rem;
    }
}

/* ستايل الأزرار العلوية مثل الفوتر */
.filter-btn {
    color: #bdc3c7 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 25px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.filter-btn.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* ستايل الناف بار العلوي */
.navbar-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navbar-links li {
    margin: 0;
}

/* ستايل الأزرار في الوضع المظلم */
body.dark-mode .filter-btn {
    color: #a0a0a0 !important;
}

body.dark-mode .filter-btn:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .filter-btn.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}

/* Extra Small Mobile (up to 320px) */
@media (max-width: 320px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0 0.25rem;
    }
    
    .app-card {
        height: 260px;
        min-height: 260px;
    }
    
    .app-card img {
        height: 80px;
        padding: 4px;
    }
    
    .app-card h3 {
        font-size: 0.8rem;
        margin: 0.2rem 0;
    }
    
    .app-card .btn {
        padding: 0.3rem 0.1rem;
        font-size: 0.65rem;
        border-radius: 4px;
        flex-grow: 1;
        min-height: 30px;
    }
    
    .app-card-actions {
        gap: 4px;
        padding: 0.3rem;
        min-height: 45px;
        flex-direction: row;
        align-items: center;
    }
}
