/* ====== LOADING SCREEN ====== */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px 20px;
    text-align: center;
}

.loading-content {
    max-width: 300px;
    width: 100%;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-secondary);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content h3 {
    color: var(--text-primary);
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.loading-content p {
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.loading-progress {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 2px;
    width: 0%;
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 0%; }
}

.loading-status {
    color: var(--text-secondary);
    font-size: 0.8em;
    display: block;
}

/* ====== MENU COMPONENTS ====== */
.menu {
    position: absolute;
    right: 10px;
}

.menu-container {
    position: relative;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    user-select: none;
}

.menu-dropdown {
    position: absolute;
    right: 0;
    white-space: nowrap;
    display: none;
    opacity: 0;
    background-color: var(--bg-secondary);
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: top right;
}

.menu-item {
    display: flex;
    background-color: var(--bg-secondary);
    align-items: center;
    padding: 12px 16px;
    user-select: none;

    svg {
        margin-right: 12px;
    }
}

/* ====== FILTER BUTTONS ====== */
.filter-btn {
    flex-shrink: 0;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-btn.active {
    transform: scale(1.08);
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-btn:not(.active) {
    filter: opacity(0.7);
}

/* ====== APP COMPONENTS ====== */
.removed-app,
.app {
    padding: 8px;
    display: flex;
    width: 100%;
    background-color: var(--bg-secondary);
    align-items: space-between;
    border: 2px solid var(--bg-secondary);
    border-radius: 10px;
    box-sizing: border-box;
    z-index: 2;
    transition: all 0.2s ease-in-out;
}

.app-selector {
    display: none;
}

.removed-app:has(.app-selector:checked),
.app:has(.app-selector:checked) {
    background-color: var(--border-color);
    border-color: var(--btn-primary);
}

.app-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.app-icon-container {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.app-icon {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    position: relative;
    z-index: 2;
    transition: opacity 0.2s ease;
    user-select: none;
}

.icon-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background-color: var(--border-color);
    color: var(--text-secondary);
    border-radius: 10px;
    z-index: 1;
}

.app-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

/* ====== APP TEXT COMPONENTS ====== */
.app-name,
.app-package,
.app-path {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    max-width: calc(100% - 20px);
}

.app-name span,
.app-package span,
.app-path span {
    display: inline-block;
    padding-right: 10px;
    animation: none;
}

.app-name {
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    user-select: none;
}

.app-package {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    user-select: none;
}

.app-path {
    color: #777;
    font-size: 12px;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    user-select: none;
}

/* ====== CATEGORY COMPONENTS ====== */
.app-category-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
}

.category-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.app-category {
    font-size: 11px;
    color: #555;
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

#app-category-container {
    margin-top: 10px;
    margin-bottom: 10px;
}

#app-category .app-category-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--bg-secondary);
    font-weight: bold;
    font-size: 12px;
    margin-right: 8px;
    vertical-align: middle;
}

.app-category-description {
    display: inline-block;
    font-size: 13px;
    color: #666;
    vertical-align: middle;
    margin-top: 6px;
}

.app-category-name {
    font-weight: 600;
    font-size: 14px;
    margin-right: 4px;
}

/* Category styling in app info modal */
.category-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  
.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
  
.category-indicator-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
  
.category-name {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    vertical-align: middle;
}
  
.category-description {
    font-size: 13px;
    color: #666;
}

/* ====== SEARCH HIGHLIGHTING ====== */
mark {
    background-color: #ffffa0;
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
    .app-package {
        color: #aaa;
    }

    .app-category {
        color: #bbb;
    }

    .icon-loading {
        background-color: #444;
        color: #aaa;
    }
    
    .app-category-description {
        color: #aaa;
    }

    .category-name {
        color: #bbb;
      }
      
    .category-description {
        color: #aaa;
    }

    mark {
        background-color: #5a5a00;
    }
}