/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #10B981;
    --primary-blue: #3B82F6;
    --dark-green: #059669;
    --dark-blue: #2563EB;
    --light-green: #D1FAE5;
    --light-blue: #DBEAFE;
    --black: #000000;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    color: var(--gray-900);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--black);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.logo:hover {
    transform: scale(1.05);
}

.logo:active {
    transform: scale(0.95);
}

.logo i {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-blue);
    color: var(--white);
}

.search-container {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: var(--white);
}

.search-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--black) 0%, var(--gray-800) 100%);
    padding: 4rem 0;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(45deg, transparent, var(--primary-green), transparent);
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Section Styles */
.section {
    background: var(--white);
    padding: 3rem 0;
    margin: 2rem 0;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-100);
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--black);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Featured Apps Grid */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.featured-card {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    border-radius: 15px;
    padding: 2rem;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.featured-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.featured-card:hover::before {
    opacity: 1;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.3);
}

.featured-card-content {
    position: relative;
    z-index: 2;
}

.featured-app-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.featured-app-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.featured-app-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.featured-app-category {
    opacity: 0.8;
    font-size: 0.9rem;
}

.featured-app-description {
    margin-bottom: 1rem;
    opacity: 0.9;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    color: #fbbf24;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    border-color: var(--primary-green);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 0.5rem;
}

.category-count {
    color: var(--gray-500);
    font-size: 0.9rem;
}

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

.app-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.3s ease;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-blue);
}

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

.app-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
}

.app-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

.app-developer {
    color: #666;
    font-size: 0.9rem;
}

.app-description {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.app-downloads {
    color: #666;
    font-size: 0.85rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    color: var(--gray-700);
}

.filter-select:focus {
    border-color: var(--primary-green);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray-400);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--white);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-header {
    background: linear-gradient(135deg, var(--black), var(--gray-800));
    color: var(--white);
    padding: 3rem 2rem 2rem;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-blue));
}

.modal-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.modal-app-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.modal-app-details {
    flex: 1;
}

.modal-app-actions {
    flex-shrink: 0;
}

.modal-app-icon {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    object-fit: cover;
}

.modal-app-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-app-developer {
    opacity: 0.9;
    font-size: 1.1rem;
}

.modal-body {
    padding: 2rem;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--black);
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 10px;
    border: 1px solid var(--gray-100);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.screenshot {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.review-content {
    flex: 1;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.review-user {
    font-weight: 600;
}

.download-btn {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, var(--dark-green), var(--primary-green));
}

.download-btn-header {
    background: var(--white);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
}

.download-btn-header::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;
}

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

.download-btn-header:hover {
    background: var(--primary-green);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.download-btn-header i {
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    margin-top: 4rem;
    border-radius: 20px 20px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 3rem 0 2rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--black);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-green);
}

.footer-bottom {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 0;
    text-align: center;
    color: var(--gray-600);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-content .nav {
        display: none;
    }
}
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .search-container {
        display: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filters {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-select {
        flex: 1;
    }
    
    .featured-grid,
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-app-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-app-info {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-app-details .rating {
        justify-content: center;
    }
    
    .modal-app-actions {
        width: 100%;
    }
    
    .download-btn-header {
        width: 100%;
        justify-content: center;
    }
    
    .modal-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-stats {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
    font-size: 1.1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}