/* App Manager Styles - Dark Theme */

.apps-manager {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    background: #1a1a2e;
}

/* Controls Row */
.app-controls {
    background: #16213e;
    padding: 8px 12px;
    border-bottom: 1px solid #0f3460;
    display: flex;
    gap: 8px;
    align-items: center;
}

.app-controls button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.app-controls button:hover {
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.4);
    color: #ff9800;
}

/* Search */
.app-search {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

.app-search::placeholder {
    color: #64748b;
}

.app-search:focus {
    border-color: rgba(255, 152, 0, 0.4);
    background: rgba(0, 0, 0, 0.4);
}

/* Filter Row */
.app-filter-row {
    background: #0f3460;
    padding: 8px 12px;
    border-bottom: 1px solid #16213e;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* User Selector */
.app-user-selector {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ff9800;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    outline: none;
    min-width: 120px;
}

.app-user-selector:hover {
    background: rgba(255, 152, 0, 0.3);
    border-color: rgba(255, 152, 0, 0.4);
}

.app-user-selector option {
    background: #1a1a2e;
    color: #e2e8f0;
}

.app-filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 5px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.app-filter-chip:hover {
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.4);
}

.app-filter-chip.active {
    background: rgba(255, 152, 0, 0.3);
    border-color: rgba(255, 152, 0, 0.5);
    color: #ff9800;
    font-weight: 600;
}

/* App List */
.app-list {
    flex: 1;
    overflow-y: auto;
    background: #1a1a2e;
    padding: 8px;
}

.app-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.app-card:hover {
    background: rgba(255, 152, 0, 0.05);
    border-color: rgba(255, 152, 0, 0.2);
}

.app-card.selected {
    background: rgba(255, 152, 0, 0.15);
    border-color: rgba(255, 152, 0, 0.4);
}

.app-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.app-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.app-icon.system {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.3);
}

.app-title {
    flex: 1;
    min-width: 0;
}

.app-name {
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-package {
    color: #64748b;
    font-size: 11px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-info {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.4;
}

.app-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 6px;
}

.app-badge.system {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.app-badge.disabled {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* App Actions Toggle (mobile) */
.app-actions-toggle {
    position: absolute;
    right: 8px;
    top: 8px;
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ff9800;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: none;
}

/* App Actions */
.app-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.app-action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
}

.app-action-btn:hover {
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.4);
    color: #ff9800;
}

.app-action-btn.danger {
    color: #ef4444;
}

.app-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Mobile */
@media (max-width: 768px) {
    .app-actions {
        display: none;
    }
    
    .app-actions-toggle {
        display: block;
    }
    
    .app-card.actions-visible .app-actions {
        display: flex;
        flex-wrap: wrap;
    }
    
    .app-card.actions-visible .app-actions-toggle {
        display: none;
    }
    
    .app-action-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    /* Hide scrollbar on mobile */
    .app-list::-webkit-scrollbar {
        display: none;
        width: 0;
    }
    
    .app-list {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}

/* Scrollbar */
.app-list::-webkit-scrollbar {
    width: 10px;
}

.app-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.app-list::-webkit-scrollbar-thumb {
    background: rgba(255, 152, 0, 0.4);
    border-radius: 5px;
}

.app-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 152, 0, 0.6);
}

/* Permission List in Dialog */
.permission-list {
    max-height: 400px;
    overflow-y: auto;
}

.permission-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.permission-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.permission-info {
    flex: 1;
    min-width: 0;
}

.permission-name {
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
}

.permission-full {
    color: #64748b;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.permission-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.permission-badge.install-time {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.permission-actions {
    display: flex;
    gap: 4px;
}

.permission-actions button {
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
}

.permission-grant {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.permission-grant:hover {
    background: rgba(76, 175, 80, 0.3);
}

.permission-revoke {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.permission-revoke:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 14px;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 14px;
}

