@font-face {
    font-family: 'IBM Plex Sans';
    src: url('assets/fonts/IBM-Plex-Sans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #000000;
    --card-bg: #111113;
    --card-hover: #1a1a1d;
    --card-border: #26262a;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --accent-color: var(--user-accent, #0a84ff);
    --accent-hover: #0071e3;
    --nav-bg: rgba(17, 17, 19, 0.85);
    --badge-bg: #ff453a;
    --text-color: var(--text-main);
    --sub-text: var(--text-muted);
    --font-family: 'IBM Plex Sans', 'IBM Plex Sans Arabic', sans-serif;
}

[data-theme="light"] {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --card-hover: #fafafa;
    --card-border: #e5e5ea;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --accent-color: var(--user-accent, #007aff);
    --accent-hover: #0063ce;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --badge-bg: #ff3b30;
    --text-color: var(--text-main);
    --sub-text: var(--text-muted);
}

/* Light / Dark Mode Class Support */
html.light-mode {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --card-hover: #fafafa;
    --card-border: #e5e5ea;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --accent-color: var(--user-accent, #007aff);
    --accent-hover: #0063ce;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --badge-bg: #ff3b30;
    --text-color: var(--text-main);
    --sub-text: var(--text-muted);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Direction Settings */
html[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Header Styles */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.75rem;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.control-btn:hover {
    background: var(--card-hover);
    border-color: var(--text-muted);
}

#themeToggleBtn:hover, #notificationBtn:hover {
    background: var(--card-hover) !important;
    border-color: var(--text-muted) !important;
    transform: scale(1.05);
}

.notification-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
}

.notification-badge {
    position: absolute;
    top: -4px;
    background-color: var(--badge-bg);
    color: white;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 600;
}

html[dir="ltr"] .notification-badge {
    right: -4px;
    left: auto;
}

html[dir="rtl"] .notification-badge {
    left: -4px;
    right: auto;
}

.lang-select {
    height: 38px;
    outline: none;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 2rem 1.5rem;
    padding-bottom: 7rem;
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.25s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Professional Cards */
.pro-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.hero-card {
    background: linear-gradient(135deg, var(--card-bg), var(--card-hover));
    border-color: var(--card-border);
    padding: 2rem;
}

.hero-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.pro-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}

.pro-btn:hover {
    background-color: var(--accent-hover);
}

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

.card-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: color-mix(in srgb, var(--accent-color) 15%, transparent);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 1.0rem;
}

.pro-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.pro-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

.nav-item i {
    font-size: 1.15rem;
}

.nav-item.active {
    color: var(--accent-color);
}

/* ==========================================================================
   Categories & Slider Styles (ڕێکخستنی پانی و قەبارەی پۆلەکان)
   ========================================================================== */
.categories-slider-container {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 1rem;
}

.categories-slider-container::-webkit-scrollbar {
    display: none;
}

.categories-track {
    display: flex;
    gap: 0.5rem;
    padding: 0.1rem 0;
    align-items: center;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 32px;
    width: auto;
    flex: 0 0 auto;
    padding: 0 0.85rem;
    background: var(--card-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--card-border, rgba(0,0,0,0.08));
    border-radius: 16px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--sub-text);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

.category-pill i {
    font-size: 0.78rem;
    color: var(--accent-color);
}

.category-pill.active {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.category-pill.active i {
    color: #ffffff;
}

/* ==========================================================================
   App Icon Shine Effect Styles (ئیفیکتی شاین بۆ ئایکۆنەکان)
   ========================================================================== */

@keyframes shineAnimation {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(30deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(30deg);
    }
}

.app-icon-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.app-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shine-effect {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shineAnimation 3s infinite ease-in-out;
    pointer-events: none;
}

/* ==========================================================================
   Premium App Detail Sheet - iOS Style (Full-Sheet Tab)
   ========================================================================== */

/* مۆداڵی سەرەکی */
.app-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 0;
    animation: fadeIn 0.3s ease;
}

/* بەشی تابەکە */
.app-detail-content {
    width: 100%;
    max-width: 500px;
    height: 90vh;
    background: var(--card-bg);
    border-radius: 30px 30px 0 0;
    padding: 25px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* دەسکەکەی سەرەوە */
.sheet-handle {
    width: 60px;
    height: 25px;
    background: rgba(120, 120, 128, 0.2);
    border-radius: 12px;
    margin: 0 auto 20px auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-color);
    transition: background 0.2s;
}

.sheet-handle:hover {
    background: rgba(120, 120, 128, 0.3);
}

.close-btn {
    display: none;
}

/* Header Styles */
.app-header-large  { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 25px; }
.app-icon-large    { width: 80px; height: 80px; border-radius: 20px; object-fit: cover; box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.app-title-group   { display: flex; flex-direction: column; justify-content: center; }

/* Tag Styles */
.app-tags       { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.app-tags:empty { display: none; margin: 0; }

.app-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: color-mix(in srgb, currentColor 15%, transparent);
    color: currentColor;
}

.app-tag-item {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background-color: color-mix(in srgb, currentColor 15%, transparent);
}

.action-buttons    { display: flex; flex-direction: column; gap: 8px; margin-inline-start: auto; }
.app-repeat-btn    { background: rgba(120, 120, 128, 0.1); border: none; padding: 6px 16px; border-radius: 20px; font-weight: 600; font-size: 12px; cursor: pointer; color: var(--text-color); }
.app-get-btn-large { background: var(--accent-color); border: none; padding: 6px 16px; border-radius: 20px; color: white; font-weight: 700; font-size: 12px; cursor: pointer; }

.app-get-btn-large:disabled {
    cursor: not-allowed;
    background-color: #ff5f58 !important;
    transition: all 0.3s ease;
}

/* Grid Info Boxes */
.app-specs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }

.spec-item {
    background: rgba(120, 120, 128, 0.06);
    padding: 12px 5px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--card-border);
}

.spec-label { font-size: 9px; color: var(--sub-text); text-transform: uppercase; margin-bottom: 4px; font-weight: 800; opacity: 0.7; }
.spec-value { font-size: 12px; font-weight: 700; color: var(--text-color); }

/* Screenshots & Lists */
.app-screenshots                   { scrollbar-width: none; -ms-overflow-style: none; }
.app-screenshots::-webkit-scrollbar { display: none; }
.app-screenshots img               { object-fit: cover; flex-shrink: 0; }

.more-in-category                      { border-top: 1px solid var(--card-border); padding-top: 20px; margin-top: 20px; }
.more-apps-list                        { display: flex; gap: 15px; overflow-x: auto; padding: 5px 0; scrollbar-width: none; }
.more-apps-list::-webkit-scrollbar     { display: none; }
.more-app-item                         { display: flex; flex-direction: column; align-items: center; min-width: 60px; cursor: pointer; }
