/*
 * Play Store-like Design for Software Page
 * Responsive for Desktop and Mobile
 */

:root {
    --playstore-primary: #4285f4;
    --playstore-primary-dark: #1967d2;
    --playstore-green: #34a853;
    --playstore-yellow: #fbbc04;
    --playstore-red: #ea4335;
    --playstore-gray: #5f6368;
    --playstore-light-gray: #f8f9fa;
    --playstore-border: #dadce0;
    --playstore-text: #202124;
    --playstore-text-secondary: #5f6368;
    --playstore-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --playstore-shadow-hover: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--playstore-light-gray);
    color: var(--playstore-text);
    line-height: 1.6;
}

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

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

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--playstore-text);
    font-size: 1.5rem;
    font-weight: 500;
}

.logo-link i {
    color: var(--playstore-primary);
    font-size: 2rem;
}

.logo-text {
    font-weight: 500;
}

.search-box {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--playstore-text-secondary);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--playstore-border);
    border-radius: 24px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--playstore-primary);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

/* Main Content */
.playstore-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--playstore-text);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--playstore-text-secondary);
}

/* Software Section */
.software-section {
    margin-top: 2rem;
}

/* Software Grid */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* App Card - Simple View (Icon + Name Only) */
.app-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--playstore-shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.05), rgba(52, 168, 83, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.app-card:hover {
    box-shadow: var(--playstore-shadow-hover);
    transform: translateY(-4px);
}

.app-icon-wrapper {
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.1);
}

.app-icon-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--playstore-primary), var(--playstore-green));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: #fff;
    font-size: 1.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.app-card:hover .app-icon-placeholder {
    transform: scale(1.1);
}

.app-info {
    position: relative;
    z-index: 1;
    width: 100%;
}

.app-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--playstore-text);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.app-rating-stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    margin-top: 0.25rem;
}

.app-rating-stars i {
    font-size: 0.75rem;
    color: var(--playstore-yellow);
}

.app-rating-stars .rating-value {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    color: var(--playstore-text-secondary);
    font-weight: 500;
}

/* App Detail Modal Styles */
.app-detail {
    padding: 0.5rem 0;
}

.app-detail-header {
    border-bottom: 1px solid var(--playstore-border);
    padding-bottom: 1.5rem;
}

.app-detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.app-detail-icon-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--playstore-primary), var(--playstore-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.app-detail-info {
    flex: 1;
}

.app-detail-name {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--playstore-text);
    margin-bottom: 0.5rem;
}

.app-detail-developer {
    font-size: 1rem;
    color: var(--playstore-text-secondary);
    margin-bottom: 0.5rem;
}

.app-detail-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--playstore-light-gray);
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--playstore-text-secondary);
}

.app-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--playstore-border);
}

.app-detail-rating,
.app-detail-downloads,
.app-detail-version {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--playstore-text-secondary);
}

.app-detail-rating {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.app-detail-rating .rating-stars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.app-detail-rating .rating-stars i {
    color: var(--playstore-yellow);
    font-size: 1.125rem;
}

.app-detail-rating .rating-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--playstore-text);
}

.app-detail-downloads i {
    color: var(--playstore-primary);
    font-size: 1rem;
}

.app-detail-screenshot {
    text-align: center;
    margin: 1.5rem 0;
}

.app-screenshot-img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.app-detail-short-desc {
    font-size: 1rem;
    color: var(--playstore-text);
    line-height: 1.6;
}

.app-detail-description h4 {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--playstore-text);
    margin-bottom: 0.75rem;
}

.app-description-text {
    font-size: 0.9375rem;
    color: var(--playstore-text-secondary);
    line-height: 1.6;
}

.app-description-text p {
    margin-bottom: 1rem;
}

.app-detail-package {
    padding-top: 1rem;
    border-top: 1px solid var(--playstore-border);
}

/* Modal Styles */
#appDetailModal .modal-dialog {
    max-width: 800px;
}

#appDetailModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#appDetailModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#appDetailModal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#appDetailModal .modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#appDetailModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--playstore-text-secondary);
}

.empty-state i {
    color: var(--playstore-border);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--playstore-text);
}

/* Footer */
.playstore-footer {
    background: #fff;
    border-top: 1px solid var(--playstore-border);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--playstore-text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 1rem;
    }
    
    .app-card {
        padding: 0.75rem;
    }
    
    .app-icon,
    .app-icon-placeholder {
        width: 56px;
        height: 56px;
    }
    
    .app-icon-placeholder {
        font-size: 1.5rem;
    }
    
    .app-name {
        font-size: 0.8125rem;
    }
    
    .header-content {
        flex-direction: column;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .logo-link {
        font-size: 1.25rem;
    }
    
    .logo-link i {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.75rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .app-card {
        padding: 0.5rem;
    }
    
    .app-icon,
    .app-icon-placeholder {
        width: 48px;
        height: 48px;
    }
    
    .app-icon-placeholder {
        font-size: 1.25rem;
    }
    
    .app-name {
        font-size: 0.75rem;
    }
    
    .app-rating-stars i {
        font-size: 0.625rem;
    }
    
    .app-rating-stars .rating-value {
        font-size: 0.625rem;
    }
    
    .app-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .app-detail-header .d-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .app-detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .app-detail-rating {
        width: 100%;
    }
}

