/* ==========================================================
   APK IMPORTER - PROFESSIONAL PLAYSTORE STYLE FRONTEND CSS
   ========================================================== */

/* Global Reset for Plugin Area */
.apk-grid-container, .apk-plugin-container {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 100%;
}

.apk-grid-container *, .apk-plugin-container * {
    box-sizing: border-box;
}

/* ----------------------------------------------------------
   HOME PAGE - APP GRID & CARD STYLES
   ---------------------------------------------------------- */
.apk-grid-container {
    width: 100%;
    margin: 20px 0 35px 0;
}

.apk-apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

/* Individual Card */
.apk-app-card {
    background: #ffffff;
    border: 1px solid #eef2f5;
    border-radius: 14px;
    padding: 14px;
    transition: transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.apk-app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    border-color: #00875a;
}

.apk-card-inner {
    text-decoration: none !important;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Fixed Modern Icon Frame */
.apk-app-icon-wrapper {
    flex-shrink: 0;
    width: 68px;
    height: 68px;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f7fa;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.apk-app-icon-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    border: none !important;
}

/* App Metadata */
.apk-app-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.apk-app-name {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #1c1e21 !important;
    margin: 0 0 3px 0 !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apk-app-dev {
    font-size: 0.78rem;
    color: #737882;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apk-app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.apk-app-vbadge {
    background: #eef9f3;
    color: #00875a;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.2px;
}

.apk-dl-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0f4f8;
    color: #00875a;
    transition: background 0.2s, color 0.2s;
}

.apk-app-card:hover .apk-dl-icon {
    background: #00875a;
    color: #ffffff;
}

/* ----------------------------------------------------------
   SINGLE APP PAGE STYLES
   ---------------------------------------------------------- */
.apk-plugin-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 15px;
}

.apk-plugin-container .apk-header-card,
.apk-plugin-container .apk-content-card,
.apk-plugin-container .apk-versions-card,
.apk-plugin-container .apk-screenshots-card,
.apk-plugin-container .apk-related-apps-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    border: 1px solid #eef2f5;
}

.apk-plugin-container .apk-header-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.apk-plugin-container .apk-icon-box img {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.apk-plugin-container .apk-title {
    margin: 0 0 6px 0;
    font-size: 1.75rem;
    color: #111;
    font-weight: 700;
    word-break: break-word;
}

.apk-plugin-container .apk-developer, 
.apk-plugin-container .apk-package {
    margin: 3px 0;
    color: #666;
    font-size: 0.9rem;
    word-break: break-all;
}

.apk-plugin-container .apk-badge {
    display: inline-block;
    background: #eef9f3;
    color: #00875a;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 8px;
}

/* Screenshots Gallery */
.apk-plugin-container .apk-screenshots-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.apk-plugin-container .apk-screenshot-item img {
    height: 280px;
    width: auto;
    border-radius: 12px;
    border: 1px solid #eee;
}

/* Tables (Responsive Wrapper) */
.apk-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.apk-plugin-container .apk-version-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.apk-plugin-container .apk-version-table th {
    background-color: #f8fafc;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 0.88rem;
    text-align: left;
}

.apk-plugin-container .apk-version-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.9rem;
}

.apk-plugin-container .apk-btn-download {
    background-color: #00875a;
    color: #ffffff !important;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-block;
}

/* Play Store Style Search Bar */
.apk-search-bar-container {
    width: 100%;
    margin: 0 auto 30px auto;
}

.apk-search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.apk-search-box:focus-within {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: #00875a;
}

.apk-search-icon {
    width: 22px;
    height: 22px;
    color: #5f6368;
    margin-right: 12px;
    flex-shrink: 0;
}

.apk-search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    font-size: 1rem !important;
    color: #202124 !important;
    padding: 8px 0 !important;
    outline: none !important;
    box-shadow: none !important;
    min-width: 0;
}

.apk-search-input::placeholder {
    color: #5f6368;
}

.apk-cat-filter {
    border: none !important;
    background: #f1f3f4 !important;
    color: #3c4043 !important;
    padding: 8px 14px !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    cursor: pointer;
    outline: none !important;
    margin-left: 10px;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%233c4043%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px top 50% !important;
    background-size: 10px auto !important;
    padding-right: 30px !important;
    flex-shrink: 0;
}

.apk-cat-filter:focus {
    background-color: #e8eaed !important;
}

.apk-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #5f6368;
    font-size: 1.1rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    grid-column: 1 / -1;
}

/* ==========================================================
   ADVANCED MOBILE RESPONSIVE OPTIMIZATIONS
   ========================================================== */

@media (max-width: 768px) {
    .apk-plugin-container {
        padding: 0 10px;
        margin: 10px auto;
    }

    .apk-plugin-container .apk-header-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 15px;
        gap: 12px;
    }

    .apk-plugin-container .apk-title {
        font-size: 1.4rem;
    }

    .apk-plugin-container .apk-header-card,
    .apk-plugin-container .apk-content-card,
    .apk-plugin-container .apk-versions-card,
    .apk-plugin-container .apk-screenshots-card,
    .apk-plugin-container .apk-related-apps-card {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .apk-plugin-container .apk-screenshot-item img {
        height: 220px;
    }
}

@media (max-width: 580px) {
    .apk-apps-grid, 
    .apk-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .apk-app-card {
        padding: 10px;
        border-radius: 12px;
    }

    .apk-app-icon-wrapper {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    .apk-card-inner {
        gap: 8px;
    }

    .apk-app-name {
        font-size: 0.82rem !important;
    }

    .apk-app-dev {
        font-size: 0.7rem;
    }

    .apk-search-box {
        padding: 8px 12px;
        border-radius: 30px;
    }

    .apk-cat-filter {
        display: none; /* মোবাইলে ক্যাটাগরি ড্রপডাউন হাইড করে সার্চ বক্স বড় রাখা হয়েছে */
    }

    .apk-plugin-container .apk-icon-box img {
        width: 80px;
        height: 80px;
        border-radius: 16px;
    }
}

@media (max-width: 400px) {
    .apk-apps-grid, 
    .apk-related-grid {
        grid-template-columns: 1fr; /* একদম ছোট স্ক্রিনে (যেমন ছোট ফোন) ১ কলামে দেখাবে */
    }
}
